These line are: 1. if (($gender eq "") || ($age eq "") || ($county eq "") || ($bracket eq "") || ($position eq "") || ($name eq "") || ($email eq "") || ($experience eq "")) { and 2. elsif ($email =~ m/\w{1,}\@\w{1,}\.\w{1,}/) { I've gone over the script millions of times, but I can't find anything wrong! Please help! :-) This is the entire script:syntax error at playerpost.cgi line 56, near ") {" syntax error at playerpost.cgi line 75, near "}" Execution of playerpost.cgi aborted due to compilation errors.
#!/usr/bin/perl print "Content-type: text/html\n\n"; use CGI::Carp qw(fatalsToBrowser); read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($key, $value) = split(/=/, $pair); $key =~ tr/+/ /; $key =~s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ tr/+/ /; $value =~s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~s/<!--(.|\n)*-->//g; if ($formdata{$key}) { $formdata{$key} .= ", $value"; } else { $formdata{$key} = $value; } } $gender = $formdata{'gender'}; $age = $formdata{'age'}; $county = $formdata{'county'}; $bracket = $formdata{'bracket'}; $position = $formdata{'position'}; $name = $formdata{'name'}; $email = $formdata{'email'}; $experience = $formdata{'experience'}; ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time); $month = $mon+1; $year1 = $year+1900; $date = "$mday\/$month\/$year1" if (($gender eq "") || ($age eq "") || ($county eq "") || ($bracket eq + "") || ($position eq "") || ($name eq "") || ($email eq "") || ($exp +erience eq "")) { print <<"PrintTag"; <html><head><title>Insufficient information</title><style> A:hover {color: "#CB5C03"; text-decoration: underline; font-family: "P +egasus"} A:link {color: "black"; font-family: "Pegasus"; text-decoration: none} A:visited {color: "#CB5C03"; text-decoration: none; font-family: "Pega +sus"} P {font-family: "Pegasus"; color:black} H1 {font-family: "Pegasus"; color:black} H3 {font-family: "Pegasus"; color:black} H2 {font-family: "Pegasus"; color:black} </style></head><body bgcolor = "#08BD29" text="black"> <BASE HREF="http://soccermb.netfirms.com/"> <img src="sidebar21.gif" align="left" width="20" height="300"><img src +="sidebar21.gif" align="right" width="20" height="300"><center><h2>In +sufficient information</h2></center> <center><h3>Please click the 'Back' button on your browser to try agai +n</h3></center> PrintTag exit; } elsif ($email =~ m/\w{1,}\@\w{1,}\.\w{1,}/) { elsif ($name =~ m/\w{3}/) { open(DATA, ">>$ENV{'DOCUMENT_ROOT'}/cgi-bin/datap.txt") || &error; flock(DATA, 2); print DATA "$gender\+$age\+$county\+$bracket\+$position\+$name\+$date\ ++$experience\+$email\n"; flock(DATA, 8); close(DATA); } else { print <<"PrintTag"; <html><head><title>Incorrect information</title><style> A:hover {color: "#CB5C03"; text-decoration: underline; font-family: "P +egasus"} A:link {color: "black"; font-family: "Pegasus"; text-decoration: none} A:visited {color: "#CB5C03"; text-decoration: none; font-family: "Pega +sus"} P {font-family: "Pegasus"; color:black} H1 {font-family: "Pegasus"; color:black} H3 {font-family: "Pegasus"; color:black} H2 {font-family: "Pegasus"; color:black} </style></head><body bgcolor = "#08BD29" text="black"> <BASE HREF="http://soccermb.netfirms.com/"> <img src="sidebar21.gif" align="left" width="20" height="300"><img src +="sidebar21.gif" align="right" width="20" height="300"><center><h2>In +correct information</h2></center> <center><h3>You must type three initials. Please click the 'Back' but +ton on your browser to try again</h3></center> PrintTag exit; } } else { print <<"PrintTag"; <html><head><title>Incorrect information</title><style> A:hover {color: "#CB5C03"; text-decoration: underline; font-family: "P +egasus"} A:link {color: "black"; font-family: "Pegasus"; text-decoration: none} A:visited {color: "#CB5C03"; text-decoration: none; font-family: "Pega +sus"} P {font-family: "Pegasus"; color:black} H1 {font-family: "Pegasus"; color:black} H3 {font-family: "Pegasus"; color:black} H2 {font-family: "Pegasus"; color:black} </style></head><body bgcolor = "#08BD29" text="black"> <BASE HREF="http://soccermb.netfirms.com/"> <img src="sidebar21.gif" align="left" width="20" height="300"><img src +="sidebar21.gif" align="right" width="20" height="300"><center><h2>In +correct information</h2></center> <center><h3>You must type your email address in the form 'email@addres +s.com'.<br>Please click the 'Back' button on your browser to try agai +n</h3></center> PrintTag exit; } sub error { print "Content-type: text/html\n\n"; print "<center>Can't open file</center>"; exit; }
In reply to Faulty Script by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |