Jump to content

Recommended Posts

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
Link to comment
https://forums.phpfreaks.com/topic/5311-form-to-email-help/
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,
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
Link to comment
https://forums.phpfreaks.com/topic/5311-form-to-email-help/#findComment-18878
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.