vickyjackson Posted March 19, 2006 Share Posted March 19, 2006 Hi,having some real problems here & I can't seem to fix it. I'm really new to this & just need a simple form but can't get it to work!I've created a form with the action set to "contactform.php" which is where the following code is...php:--------------------------------------------------------------------------------<? $name = $_POST["name"];$email = $_POST["email"];$phone = $_POST["phone"];$address = $_POST["address"];$package = $_POST["package"];$comments = $_POST["comments"];$today = date("d, M Y");$recipient = "vicky@something.co.uk";$subject = "Enquiry from the Website";$forminfo ="Name: $name\nEmail: $email\nPhone: $phone\nAddress: $address\nInterested in: $package\nMessage: $comments\n Form Submitted: $today\n\n";mail("vicky@something.co.uk", "Contact from Website", $forminfo, "From: $email");header("Location: [a href=\"http://www.something.co.uk/thankyou.php?name=$_POST\" target=\"_blank\"]http://www.something.co.uk/thankyou.php?name=$_POST[/a][name]"); ?>--------------------------------------------------------------------------------Then I have thankyou page set up to display the text.."thankyou (name) your info has been submitted etc.The thankyou page is working, with the name displaying correctly but no emails are coming through. I have tried a different email address but still no luck. The 'thankyou' and 'contactform' are both php pages but the page with the initial form on is not - does this matter?I have checked that all the form textboxes etc match upto the names set in the php - don't know what else to try.If anyone could help I would appreciate it sooo much.Thanks,Vicky Quote Link to comment https://forums.phpfreaks.com/topic/5311-form-to-email-help/ Share on other sites More sharing options...
hitman6003 Posted March 19, 2006 Share Posted March 19, 2006 Add the following to the top of your contactform.php:[code]ini_set("error_reporting", "E_ALL");ini_set("display_errors", "1");[/code]It should display any errors that are occuring. Quote Link to comment https://forums.phpfreaks.com/topic/5311-form-to-email-help/#findComment-18875 Share on other sites More sharing options...
vickyjackson Posted March 19, 2006 Author Share Posted March 19, 2006 I added the code at the end of the php but before the end tag - but no errors were displayed. Any other ideas?? Just really frustrating - been on this for hours!Thanks so much,VickySorry - misread that - been looking at the screen too long. Have put it at the start of the code but still no luck - is it still meant to be within the php tag?Thanks Quote Link to comment https://forums.phpfreaks.com/topic/5311-form-to-email-help/#findComment-18878 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.