lopdog Posted August 13, 2010 Share Posted August 13, 2010 I've got a problem with a php code it doesn't work ...It gives me an error : Parse error: syntax error, unexpected T_STRING in /home/rasi4325/public_html/sending.php on line 8 the html code is this : <form action="sending.php" method="post" name="Contact Form" id="form1" onsubmit="MM_validateForm('E-mail','','R')return document.MM_returnValue" encytype="text/plain"> <label>Va rugam introduceti adresa de e-mail pentru a primii ultimile noutati.</label> <input type="text" name="Email" size="29" id="Email" title="Email" /> <input name="Submit" type="submit" id="Submit" value="Submit" /> </form> the php code is this ": <?php $Name = $_REQUEST['Name']; $Email = $_REQUEST['Email']; $Phone = $_REQUEST['Phone']; $Message = $_REQUEST['Message']; /*Sending Email*/ $to = "support@test.ro"; $subject = "Cerere Stiri"; $message = " Contact Client Email = $Email $from = "$Email"; if(mail($to, $subject, $message, "From: $from")) echo "Mail sent"; else echo "Mail send failure - message not sent"; Quote Link to comment https://forums.phpfreaks.com/topic/210657-need-help-error/ Share on other sites More sharing options...
wildteen88 Posted August 13, 2010 Share Posted August 13, 2010 You've not closed the string correctly here $message = " Contact Client Email = $Email Add "; after $Email Quote Link to comment https://forums.phpfreaks.com/topic/210657-need-help-error/#findComment-1098918 Share on other sites More sharing options...
Maq Posted August 13, 2010 Share Posted August 13, 2010 These types of errors should be easily detectable from syntax highlighting. What IDE/editor are you using? Quote Link to comment https://forums.phpfreaks.com/topic/210657-need-help-error/#findComment-1099004 Share on other sites More sharing options...
lopdog Posted August 14, 2010 Author Share Posted August 14, 2010 Thanks wildteen88 that did it... but now I have another problem I want to redirect the page so that it apears a message and redirects you to index.html. the code in php is this. I TRYED "header("url") echo "<meta http-equiv=\"refresh\" content=\"2;url=index.html\" />"; and url long way and both of them gives me this error: Parse error: syntax error, unexpected T_ELSE in /home/rasi4325/public_html/sending.php on line 17 <?php $Email = $_REQUEST['Email']; $Message = $_REQUEST['Message']; /*Sending Email*/ $to = "support@text.com"; $subject = "Cerere Stiri"; $message = "Contact Client Email = ".$Email." "; $from = "$Email"; if(mail($to, $subject, $message, "From: $from")) echo "Message sent"; else echo "Mail not sent please try again"; ?> PS: I am working on an html with css and this code is the only php code I'm using Quote Link to comment https://forums.phpfreaks.com/topic/210657-need-help-error/#findComment-1099217 Share on other sites More sharing options...
iJoseph Posted August 14, 2010 Share Posted August 14, 2010 Try this: <?php $Email = $_REQUEST['Email']; $Message = $_REQUEST['Message']; /*Sending Email*/ $to = "support@text.com"; $subject = "Cerere Stiri"; $message = "Contact Client Email = ".$Email." "; $from = "$Email"; if(mail($to, $subject, $message, "From: $from")) { echo "Message sent"; headder( "location: index.html"); } else{ echo "Mail not sent please try again"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/210657-need-help-error/#findComment-1099224 Share on other sites More sharing options...
lopdog Posted August 17, 2010 Author Share Posted August 17, 2010 Thx iJoseph that did it . Thank you verry mutch Quote Link to comment https://forums.phpfreaks.com/topic/210657-need-help-error/#findComment-1100235 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.