I am simply pulling this code from an existing PHP script, but now I am getting an unexpected $end in the file line 40. Any ideas on where I am messing up on this? The close tag looks fine to me.
[code=php]<?php
if(trim($_POST[‘name’]) == “”) {
die(“You did not enter a name”);
}
if(trim($_POST[’email’]) == “”) {
die(“You did not enter an email”);
$con = mysql_connect(“database”,”name”,”pass”);
if (!$con)
{
die(‘Could not connect: ‘ . mysql_error());
}
mysql_select_db(“database”, $con);
$sql=”INSERT INTO Table (Name, Email, Date)
VALUES
(‘$_POST[name]’,’$_POST[email]’,’$_POST[Date]’)”;
if (!mysql_query($sql,$con))
{
die(‘Error: ‘ . mysql_error());
}
echo “”;
$subject = ‘subject’;
$message = ‘message ‘;
$header = “From: Independent Retail Week: NYC”;
mail($_POST[’email’],$subject,$message,$header);
mysql_close($con)
?>