lbnja Posted September 1, 2008 Share Posted September 1, 2008 I have tried to keep it simple but without success. The following code returns to the originating web page, not the THANKYOU page, and it does not send the email. I'm new to php and I must have missed something. Can anyone help me ? <?php $thankyouurl = "http://www.bidets4sale.com/THANKYOU.htm" ; $mailto = 'feedback@bidets4sale.com' ; $subject = "FEEDBACK" ; $selected_radio = $_POST['how']; $keyword = $_POST['keyword'] ; $consent = $_POST['consent'] ; $name = $_POST['name'] ; $mail = $_POST['mail'] ; $comments = $_POST['comments'] ; $messageproper = "This message was sent from:\n" . "Name of sender: $name\n" . "Email of sender: $mail\n" . "How did I find website : $selected_radio\n" . "$consent\n" . "$keyword\n" . "$comments\n" .; { mail($mailto, $subject, $messageproper);} header( "Location: $thankyouurl" ); exit ; Quote Link to comment https://forums.phpfreaks.com/topic/122285-help-please/ Share on other sites More sharing options...
Fadion Posted September 1, 2008 Share Posted September 1, 2008 Change these lines: "$comments\n" .; { mail($mailto, $subject, $messageproper);} header( "Location: $thankyouurl" ); exit ; to: <?php "$comments\n"; //removed the last dot as you weren't concatenating anything mail($mailto, $subject, $messageproper); //removed the curly braces header('Location: thankyou.html'); //i used a relative path and you should use it if the file isn't hosted somewhere remotely ?> Consider also adding some headers, clearly described in the manual. Quote Link to comment https://forums.phpfreaks.com/topic/122285-help-please/#findComment-631433 Share on other sites More sharing options...
lbnja Posted September 2, 2008 Author Share Posted September 2, 2008 Thank you for your suggestions. I changed the code as follows but I still have both problems occuring. <?php $thankyouurl = 'http://www.bidets4sale.com/THANKYOU.htm' ; $mailto = "feedback@bidets4sale.com" ; $subject = "FEEDBACK" ; $selected_radio = $_POST['how']; $keyword = $_POST['keyword'] ; $consent = $_POST['consent'] ; $name = $_POST['name'] ; $mail = $_POST['mail'] ; $comments = $_POST['comments'] ; $messageproper = "This message was sent from:\n" . "Name of sender: $name\n" . "Email of sender: $mail\n" . "How did I find website : $selected_radio\n" . "$consent\n" . "$keyword\n" . "$comments\n" ; mail($mailto, $subject, $messageproper); header( 'Location: http://www.bidets4sale.com/THANKYOU.htm' ); ?> Quote Link to comment https://forums.phpfreaks.com/topic/122285-help-please/#findComment-631630 Share on other sites More sharing options...
JonnoTheDev Posted September 2, 2008 Share Posted September 2, 2008 Is your form actually submitting? Can you print the user entered input to the screen after the form has been posted to test. Also your mail function is missing the mail headers. Check out the mail() function on php.net for a description of mail headers. Quote Link to comment https://forums.phpfreaks.com/topic/122285-help-please/#findComment-631781 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.