nevx Posted June 28, 2006 Share Posted June 28, 2006 can anyone help me out i keep gettin this error when i run this sricptParse error: syntax error, unexpected $end in C:\wamp\www\php\testhandle_form.php on line 50i have the html page set up alreadythis is th php page[code]<?php$name=$_POST['name'];$comments=$_POST['comments'];$email=$_POST['email'];$gender=$_POST['gender']; if (Strlen($name)>0) { $name=stripslashes($name); }else { $name=NULL; echo '<p><b>You forgot to enter your name!</b></p>';} if (Strlen($comments)>0) { $comments=stripslashes($comments); }else { $comments=NULL; echo '<p><b>You forgot to enter your comments!</b></p>';}//check emailif (!(strlen($email)>0)) { $email=NULL; echo'<p><b>You forgot to enter your email!</b></p>';} // genderif (isset($gender)){ if($gender =='M') { $message='<b><p>Good Day , Sir!</p></b>'; }elseif ($gender=='F') { $message='<b><p>Good Day , Madam!</p></B>'; } else { $gender=NULL; echo'<p><b>You Forgot to enter your gender!</b></P>'; } //if everything was filled outif ($name && $comments && $email && $gender) { echo ('Thank you , <b> $name </b> for the following commnets:<br><tt> $comments </tt><br>'); echo $message; }?>[/code]any help appreciated thanks Quote Link to comment https://forums.phpfreaks.com/topic/13083-parse-error-syntax-error-unexpected-end/ Share on other sites More sharing options...
wildteen88 Posted June 28, 2006 Share Posted June 28, 2006 You have forgot to add a closing } after this:[code]elseif ($gender=='F') { $message='<b><p>Good Day , Madam!</p></B>'; } else { $gender=NULL; echo'<p><b>You Forgot to enter your gender!</b></P>'; }} // this was missing[/code] Quote Link to comment https://forums.phpfreaks.com/topic/13083-parse-error-syntax-error-unexpected-end/#findComment-50423 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.