Hello,
I have a guestbook created in PHP and was having a problem with blank entries. I was on here a few weeks ago getting help and then the board went down. Anyway, I learned about javascript field verification and was told to look into PHP verification as well, just in case.
Can someone please help me figure out my the following code is generating this parse error?
Parse error: parse error, unexpected T_STRING in /hsphere/local/home/agfagf/agruesomefind.com/php/submit.php on line 10
Even though I get the error, it seems to be sending a blank email with no information at all....
Any help would be greatly appreciated, thanks!
<?php
$name = $_POST['name'] ;
$email = $_POST['email'] ;
$location = $_POST['location'] ;
$site_url = $_POST['site_url'] ;
$comments = $_POST['comments'] ;_
// verify if any stated fields has empty values
if_(empty($comments))_{_
____header("Location: error.php");_
}_else_{_
____// check if magic_quotes_gpc is On or Off
____if_(!get_magic_quotes_gpc())_{___
________$comments_=_addslashes($comments);___
____}_else_{___
________$comments_=_$comments;___
____}_
____// process the submission here
____$sql_=_mysql_connect ("xxxx", "xxxx", "xxxx");
mysql_select_db (agfagf_vileart_distro);
$sql = mysql_query ("INSERT INTO agf_guestbook (name, email, location, site_url, comments)
VALUES ('$name', '$email', '$location', '$site_url', '$comments')
");
print ("Guestbook entry successful");
____
____// Grab last record input
____$sql_=_mysql_query("SELECT * FROM agf_guestbook ORDER BY entry_id DESC LIMIT 1")_or_die_(mysql_error());
____$row_=_mysql_fetch_array($sql);
____
____## FORMAT EMAIL ##############################
____
____// set email header
____$header_=_"From:_$ravenwind@agruesomefind.com\n";
____$header_.=_"MIME-Version: 1.0\n";
____$header_.=_"Mailer: FCG Browser-Based Applications\n";
____$header_.=_"Content-Type: text/plain; charset=\"iso-8859-1\"\n";
____
____// set destination
____$sendto_=_"$ravenwind@agruesomefind.com\n";
____
____// set subject
____$subject_=_"Enter and subject you want to display in subject area\n";
____
____// build message
____$message_=_"New guestbook posted on ".date("F j, Y")."\n";
____$message_.=_"\n";
____$message_.=_"http://www.agruesomefind.com/php/guestbook.php?id=".$row["entry_id"]."\n";
____
____// send email
____mail($sendto,$subject,$message,$header);
_____
____## END EMAIL ##################################
____header("Location: guestbook.php");_
}
?>