Hey guys, I'm getting an error on this CGI script, I can't seem to find it.
here is the html and the script
And here is the script:
here is the html and the script
Code:
<form name="form1" method="post" action="reviews.cgi">
<p align="center"><b><font color="#5E00BB" size="6"> </font><font size="6"><span class="style5">Rate -A- Resort </span></font></b></p>
<p align="center"> <img src="../palmtree.jpg" width="112" height="147"></p>
<table width="75%" border="0" bordercolor="#000000">
<tr>
<td width="44%" height="33" valign="top">
<div align="right" class="style6">Resort</div>
</td>
<td width="56%" valign="top">
<input name="resortname" type="text" id="resortname" size="40">
</td>
</tr>
<tr>
<td width="44%" height="97" valign="top">
<div align="right" class="style6">Your Review</div>
</td>
<td width="56%" height="97" valign="top">
<textarea name="review" cols="40"></textarea>
</td>
</tr>
<tr>
<td width="44%" height="47" valign="top">
<div align="right" class="style6">Time Stayed</div>
</td>
<td width="56%" valign="top">
<input name="time" type="text" id="time">
</td>
</tr>
<tr>
<td width="44%" height="41" valign="top">
<div align="right" class="style6">Your Name</div>
</td>
<td width="56%" valign="top">
<input name="yourname" type="text" size="40">
</td>
</tr>
<tr>
<td width="44%" height="40" valign="top">
<div align="right" class="style6"> Rating</div>
</td>
<td width="56%" valign="top">
<input type="radio" name="rate" value="1">
1
<input type="radio" name="rate" value="2">
2
<input type="radio" name="rate" value="3">
3
<input type="radio" name="rate" value="4">
4
<input type="radio" name="rate" value="5">
5 </td>
</tr>
<tr>
<td width="44%" height="41" valign="top">
<div align="right" class="style6">Anonymous</div>
</td>
<td width="56%" valign="top">
<input type="checkbox" name="anonymous" value="1">
</td>
</tr>
<tr>
<td colspan="2">
<div align="center">
<input type="submit" name="Submit" value="Submit">
Code:
#!/usr/bin/perl
print "Content-type:text/html\n\n";
use CGI qw/:standard/;
$resortname=param('resortname');
$review=param('review');
$time=param('time');
$rate=param('rate');
$anonymous=param('anonymous');
if($anonymous != 1)
{
$yourname=param('yourname');
}
else
{
$yourname=anonymous;
}
open(OUTF,">>reviews.txt");
print OUTF "\n<b>$yourname</b>stayed for <b>$age</b> and rated the resort <b>$moviename</b> with a <b>";
for ($i=1;$i<=$rate;$i++){
print OUTF "<img src=\"images/star.gif\"> ";
}
print OUTF "$rate</b> star rating --<br>Review:<br> <b>$review</b>";
close(OUTF);
open(COUNTF,"numvisiotrs.txt");
$counter=<COUNTF>;
close(COUNTF);
chop($counter);
$counter++;
open(COUNTF,">numvisiotrs.txt");
print COUNTF $counter,"\n";
close(COUNTF);
if($counter eq 5)
{
print "<html><head><title>Review Output</title></head><body>";
print "<h2>Congratulations ! You are the visitor number 5 !</h2>";
print "</body>";
}
print "<<na<html><head><title>Review Output</title></head><body>Thank you for your time. <p>Your review was successfully saved as number $counter</p><p> Please click on the following link to see all reviews: <a href="[URL unfurl="true"]http://matrix.csis.pace.edu/~panavian/cgi-bin/showreviews.cgi">see[/URL] all reviews</a>.</body>na";