Please disregard this post. I found the problem.
This is a production page that I've somehow broken. (It was semi-working before, but cookies were not being set properly. The error message it's now throwing is "
Parse error: syntax error, unexpected ',' in
X:\Documents\webdev\localhost\dhs57\postcomment.ph p on line
209"
Line 209 in the code below is the first "setcookie" line.
If I comment out line 209, the error changes to read 210. If I comment out 209 and 210, the error still says 210. I don't see anything wrong with 209, 210 or anything before or after but I must be missing something. Hopefully someone here will see it.
- PHP: Select all
$query = "INSERT INTO `comments` ( `ID` , `eventID` , `name` , `comment` ) ".
"VALUES (NULL , '".$eventid."', '".$postname."', '".$postmsg."')";
#echo $bdo."PC236<br>query=$query".$edo;
#echo $bdo."PC237 - This is where we run the insert query".$edo;
$result = mysql_query($query,$dblink) or die(mysql_error());
if ($result) {
#echo $bdo."PC238 - comments posted successfully".$edo;
unset($_SESSION['eventid']);
unset($_SESSION['postmsg']);
if ($eventid < 20000) {
$cmid = $eventid - 10000;
$query = "SELECT Email FROM alumni WHERE ID = '".$cmid."'";
$result = mysql_query($query,$dblink) or die(mysql_error());
$rec = mysql_fetch_array($result);
$sendto = $rec['Email'];
if (strpos($sendto,"@") > 0) {
$headers = "From: webmaster@dhs57.com";
$subject = $postname.' has "signed your yearbook"!';
$msgtext = $postname.' has "signed your yearbook" on DHS57.com. Check it out at http://www.dhs57.com - click on Classmates, then click on your name to see what your classmate had to say!';
$sent = mail($sendto, $subject, $msgtext, $headers);
}
}
setcookie("UserID", $_SESSION['userid'], time()+86400*180), "/", "dhs57.stickpuppy.com"); /* expire in 180 days */
setcookie("postname", $_SESSION['postname'], time()+86400*180), "/", "dhs57.stickpuppy.com"); /* expire in 180 days */
echo "<p>Your comment has been posted. Please <a href='".$return2."'>click here</a> or use your browser's 'Back' button to return to where you were.</p>";
} else {
#echo $bdo."PC239 - comment could not be posted".$edo;
echo "An unknown error has occurred. Your comment could not be posted. Please ".
"<a href='contact.php?msgid=57121'>notify the webmaster</a>.";
}
}
?>