Jump to content


This topic is now archived and is closed to further replies.


Form to Email help!

Recommended Posts

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...


$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\n
Email: $email\n
Phone: $phone\n
Address: $address\n
Interested in: $package\n
Message: $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.


Share this post

Link to post
Share on other sites
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.

Share this post

Link to post
Share on other sites
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,

Sorry - 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?

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.