Cruiz Risner Posted January 13, 2010 Share Posted January 13, 2010 I am getting this error: "Parse error: syntax error, unexpected T_VARIABLE in /home/cruiz/public_html/phpmail.php on line 10" for this code <html> <body> <?php if (isset($_REQUEST['email'])) //if "email" is filled out, send email { //send email $to = $_REQUEST['to'] $email = $_REQUEST['email'] ; $subject = $_REQUEST['subject'] ; $message = $_REQUEST['message'] ; mail( "TO: $to", "Subject: $subject", $message, "From: $email" ); echo "Thank you for using my fake mail system. Simple is great."; } else //if "email" is not filled out, display the form { echo "<form method='post' action='index.php'> TO: <input name='TO' type='text' /><br /> Email: <input name='email' type='text' /><br /> Name: <input name='subject' type='text' /><br /> Message:<br /> <textarea name='message' rows='15' cols='40'> </textarea><br /> <input type='submit' /> </form>"; } ?> </body> </html> can anyone fix this? Quote Link to comment https://forums.phpfreaks.com/topic/188291-parse-error-syntax-error-unexpected-t_variable/ Share on other sites More sharing options...
mikesta707 Posted January 13, 2010 Share Posted January 13, 2010 this line needs a semi colon $to = $_REQUEST['to']; Quote Link to comment https://forums.phpfreaks.com/topic/188291-parse-error-syntax-error-unexpected-t_variable/#findComment-994036 Share on other sites More sharing options...
Cruiz Risner Posted January 13, 2010 Author Share Posted January 13, 2010 wholly crap i cant believe i missed that. lol i need to get some sleep im like zombie. thanks man Quote Link to comment https://forums.phpfreaks.com/topic/188291-parse-error-syntax-error-unexpected-t_variable/#findComment-994037 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.