Jump to content


Photo

Form to Email help!


  • Please log in to reply
2 replies to this topic

#1 vickyjackson

vickyjackson
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 19 March 2006 - 08:24 PM

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

Thanks,
Vicky

#2 hitman6003

hitman6003
  • Members
  • PipPipPip
  • Advanced Member
  • 1,807 posts

Posted 19 March 2006 - 08:33 PM

Add the following to the top of your contactform.php:

ini_set("error_reporting", "E_ALL");
ini_set("display_errors", "1");

It should display any errors that are occuring.

#3 vickyjackson

vickyjackson
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 19 March 2006 - 08:40 PM

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,
Vicky

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users