![]() | | ||||||||
| | #1 | |
| The Cake Is A Lie War Room Member Join Date: Oct 2004 Location: Mackay, QLD, Australia
Posts: 2,165
Thanks: 291
Thanked 641 Times in 370 Posts
|
Hi Warriors, I recently set up a form on my website for clients to fill out. It's at my new site, which you can check out at: Turbocharge Your Website's Sales With Copy That is Guaranteed to Get Results! Down near the end there is a form to fill out and submit. Here's the problem: I tested it by filling out the fields and hitting the submit button. The email comes through fine, but although the fields are listed (name, email etc) the information that I filled in was not... meaning that it's broken somewhere. I had a look at the code and it SEEMS okay to me, so I'm not sure why this is happening. By the way, the code calls a script called "contact.php" which is found at: Contact email error In case it's easier, though, I've included it here: Quote:
Can anyone help me out here? Kind regards, -Dan | |
| | |
| | #2 |
| Warrior Member War Room Member Join Date: May 2009 Location: Maidens, VA
Posts: 25
Thanks: 7
Thanked 3 Times in 3 Posts
|
Assuming the code you provided is all the code to handle the post... register globals is off (as it should be for better security). In the email, you are using "$name", etc, but in the if statement you are using $_POST['name']. $name does not exist unless register globals is on (and future versions of PHP will not even allow this). Change the code in your $body declaration to reference the field names with the appropriate $_POST variable. So... inside of the email body, use {$_POST['name']} instead of $name. Use the curly brackets to guarantee that it gets interpreted correctly. |
| | |
| | #3 |
| Took The Red Pill War Room Member Join Date: Apr 2006 Location: Here and Now
Posts: 374
Thanks: 124
Thanked 106 Times in 64 Posts
|
Hi Dan, The variables $name, $email etc have not been assigned in the script and are therefore empty. The values you want are still in the $_POST array. Try putting some assignments like this at the top of the script: $name = $_POST["name"] $email = $_POST["email"] etc... after that you could tidy up by changing all further occurrences of $_POST["varname"] to $varname Regards, Phil |
| | |
| | #4 |
| The Cake Is A Lie War Room Member Join Date: Oct 2004 Location: Mackay, QLD, Australia
Posts: 2,165
Thanks: 291
Thanked 641 Times in 370 Posts
|
Hey guys, YOU'RE AWESOME! Thanks so much... this fixed the problem. You guys should put your PayPal address in the "buy me a beer" part so people like me can give you a couple of bucks for helping out. -Dan |
| | |
![]() |
|
| Tags |
| figure, form, submitting, text |
| Thread Tools | |
| |
![]() |