frijole Posted January 31, 2008 Share Posted January 31, 2008 Parse error: syntax error, unexpected $end in /home/thinksna/public_html/email.php on line 35 <?php /*Program: email.php *Desc: PHP program that sends an email address to the DB for a mailing list. */ if(ini_get("magic_quotes_gpc") == "1") { $_POST['email'] = stripslashes($_POST['email']); } $host="localhost"; $user="removed"; $password="removed"; if(!empty($_POST['form'])) { mysql_connect($host,$user,$password); mysql_select_db(thinksna_email); $result = mysql_query($_POST['email']); if($result == false) { echo "<h4>Error: ".mysql_error($cxn)."</h4>"; } else { $email = $_POST['email']; mysql_query("INSERT INTO email (email, email_id, dateTime) VALUES ('$email', '' , NOW())") or die(mysql_error()); echo "'$email' was added to the list"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/88668-solved-syntax-error-unexpected-end/ Share on other sites More sharing options...
AndyB Posted January 31, 2008 Share Posted January 31, 2008 You forgot to close the loop that began if(!empty) ... one look at your idented code shows that easily Quote Link to comment https://forums.phpfreaks.com/topic/88668-solved-syntax-error-unexpected-end/#findComment-454093 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.