CGI security script
Hi
I'm trying to write a script and I get a syntax error near "if" and near "else"
Here is what I have so far:
Quote:
#!/usr/local/bin/perl
$o=$ENV{HTTP_REFERER;
if($o=~home.html) {;
print "Content-type: text/html\n\n";
print "You cheater \n";
else{;
print "You won. Congratulations";
Everything works fine except that
My server for some reason requires ; after every line, not just the wanted end
I have seen different so don't think me crazy! lol
Orpheus posted this at 23:24 — 2nd October 2000.
They have: 568 posts
Joined: Nov 1999
#!/usr/local/bin/perl
print "Content-type: text/html\n\n";
$o=$ENV{HTTP_REFERER;
if($o=~/home.html/) {
print "You cheater \n";
} else {
print "You won. Congratulations";
}
nike_guy_man posted this at 19:50 — 3rd October 2000.
They have: 840 posts
Joined: Sep 2000
Still doesn't work
Debugger says:
Syntax error near "if"
roBofh posted this at 21:08 — 3rd October 2000.
They have: 122 posts
Joined: Jun 2000
$o=$ENV{HTTP_REFERER;
should be
$o=$ENV{HTTP_REFERER};
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.