CGI security script

nike_guy_man's picture

They have: 840 posts

Joined: Sep 2000

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

http://www.e-ngl.net

Laughing out loud

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's picture

They have: 840 posts

Joined: Sep 2000

Still doesn't work
Debugger says:
Syntax error near "if"

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.