tomala90 Posted November 1, 2009 Share Posted November 1, 2009 Hi guys, anyone knows why do I keep getting a phrase errors? " Parse error: syntax error, unexpected '{' in /home/a7576050/public_html/email.php on line 30 " Here is the code to my script <?php $to = "[email protected]"; $subject = "Invitation"; $email = $_REQUEST['email'] ; $message = $_REQUEST['message'] ; $headers = "From: $email"; $sent = mail($to, $subject, $message, $headers) ; if($sent) {print "Your email was sent"; } f( isset($_REQUEST['email']) && isset($_REQUEST['message']) ) { $email = $_REQUEST['email']; $message = $_REQUEST['message']; if($email == "" || $message == "") { echo "<br /><br />You did not fill out the form"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/179799-need-your-help-very-important/ Share on other sites More sharing options...
hackerkts Posted November 1, 2009 Share Posted November 1, 2009 <?php $to = "[email protected]"; $subject = "Invitation"; $email = $_REQUEST['email'] ; $message = $_REQUEST['message'] ; $headers = "From: $email"; $sent = mail($to, $subject, $message, $headers) ; if($sent) {print "Your email was sent"; } if( isset($_REQUEST['email']) && isset($_REQUEST['message']) ) { $email = $_REQUEST['email']; $message = $_REQUEST['message']; if($email == "" || $message == "") { echo "<br /><br />You did not fill out the form"; } } ?> You forgotten to close your curly braces and one of your if statement you left out the "i". Quote Link to comment https://forums.phpfreaks.com/topic/179799-need-your-help-very-important/#findComment-948570 Share on other sites More sharing options...
tomala90 Posted November 1, 2009 Author Share Posted November 1, 2009 That fixed the error phrase problem, but now I am getting something like this. No matter if I put the information or no, I press "submit" it shows me that I did not fill out the form , and after this there are some weird symbols " ℼⴭ眠睷〮〰敷桢獯潣湁污瑹捩潃敤ⴠ㸭猼牣灩⁴祴数∽整瑸樯癡獡牣灩≴猠捲∽瑨灴⼺愯慮祬楴獣栮獯楴杮㐲挮浯振畯瑮瀮灨㸢⼼捳楲瑰ാ㰊潮捳楲瑰㰾牨晥∽瑨灴⼺眯睷栮獯楴杮㐲挮浯∯㰾浩牳㵣栢瑴㩰⼯湡污瑹捩潨瑳湩㉧⸴潣⽭潣湵桰≰愠瑬∽敷潨瑳湩≧⼠㰾愯㰾港獯牣灩㹴ℼⴭ䔠摮传湁污瑹捩潃敤ⴠ㸭 " Quote Link to comment https://forums.phpfreaks.com/topic/179799-need-your-help-very-important/#findComment-948574 Share on other sites More sharing options...
tomala90 Posted November 1, 2009 Author Share Posted November 1, 2009 I also do not get the email to my mailbox Quote Link to comment https://forums.phpfreaks.com/topic/179799-need-your-help-very-important/#findComment-948575 Share on other sites More sharing options...
hackerkts Posted November 1, 2009 Share Posted November 1, 2009 I would suggest you to check if the values are passed to the page, try echo-ing out your email and message. Quote Link to comment https://forums.phpfreaks.com/topic/179799-need-your-help-very-important/#findComment-948576 Share on other sites More sharing options...
tomala90 Posted November 1, 2009 Author Share Posted November 1, 2009 I am kind of new to PHP and I dont exactly understand what you want me to do Quote Link to comment https://forums.phpfreaks.com/topic/179799-need-your-help-very-important/#findComment-948580 Share on other sites More sharing options...
hackerkts Posted November 1, 2009 Share Posted November 1, 2009 add this below <?php echo "Email: ".$email."<br />Message: ".$message; submit the button and see if there's anything pass through. Quote Link to comment https://forums.phpfreaks.com/topic/179799-need-your-help-very-important/#findComment-948581 Share on other sites More sharing options...
tomala90 Posted November 1, 2009 Author Share Posted November 1, 2009 Unfortunately, that did not change anything, still see these symbols, same message, and no email in my mailbox Quote Link to comment https://forums.phpfreaks.com/topic/179799-need-your-help-very-important/#findComment-948584 Share on other sites More sharing options...
hackerkts Posted November 1, 2009 Share Posted November 1, 2009 Those symbol you seeing could be problem with language, maybe you can try find some online emailing script. Quote Link to comment https://forums.phpfreaks.com/topic/179799-need-your-help-very-important/#findComment-948585 Share on other sites More sharing options...
tomala90 Posted November 1, 2009 Author Share Posted November 1, 2009 There should not be any problem with language. I have a script that works but it is a simple one, and for example when some one do not fill out the form and hit submit I get an email from nobody, no email no message. So I am trying to avoid this by developing my scrip but I cant get it right This is my simple script that works <?php $to = "[email protected]"; $subject = "Invitation"; $email = $_REQUEST['email'] ; $message = $_REQUEST['message'] ; $headers = "From: $email"; $sent = mail($to, $subject, $message, $headers) ; if($sent) {print "your email was sent"; } else {print "En error has occurred, try again , "; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/179799-need-your-help-very-important/#findComment-948587 Share on other sites More sharing options...
Gayner Posted November 1, 2009 Share Posted November 1, 2009 There should not be any problem with language. I have a script that works but it is a simple one, and for example when some one do not fill out the form and hit submit I get an email from nobody, no email no message. So I am trying to avoid this by developing my scrip but I cant get it right This is my simple script that works <?php $to = "[email protected]"; $subject = "Invitation"; $email = $_REQUEST['email'] ; $message = $_REQUEST['message'] ; $headers = "From: $email"; $sent = mail($to, $subject, $message, $headers) ; if($sent) {print "your email was sent"; } else {print "En error has occurred, try again , "; } ?> Easy. Were are u getting $_REQUEST from ? lol Quote Link to comment https://forums.phpfreaks.com/topic/179799-need-your-help-very-important/#findComment-948612 Share on other sites More sharing options...
Daniel0 Posted November 1, 2009 Share Posted November 1, 2009 Try adding a Content-type header with a charset to the email. E.g. like this: <?php $to = "[email protected]"; $subject = "Invitation"; $email = $_REQUEST['email'] ; $message = $_REQUEST['message'] ; $headers = "From: $email\r\nContent-type: text/plain; charset=utf-8"; $sent = mail($to, $subject, $message, $headers) ; if($sent) {print "your email was sent"; } else {print "En error has occurred, try again , "; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/179799-need-your-help-very-important/#findComment-948638 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.