Forum Moderators: coopster
I get the email, I see the field headers, but no data. The email comes to me and looks like this:
Requested by:
Address:
City:
State:
Zip:
Email:
Here's a short version of that process:
(?php
//Declare the variables
$address = "";
//Get the contents of form
$address = $_POST['address'];
//mail() function sends the mail
mail($to,$subject, "Revision request submitted on $today\n
\n
Address: $address");
?)
I started with a sample script that I downloaded and did get it to work, but this new version doesn't and I'm not seeing what the heck is different!
Thanks,
Christian
That is why I added the Declarations..
The first should resent and initialize, which I didn't think is really needed, because the loading of the variables with the
$address = $_POST['address'];
Adding this in the sample script I was able to get it to work. It was the move to the production script that is driving me crazy... I know it's something simple. Here's all of what I have:
<?php
//Declare the variables
//$by = "";
//$address = "";
//$city = "";
//$state = "";
//$zip = "";
//$email = "";
//$comments = "";
$today = date("F j, Y, g:i a");
//Get the contents of form
$by = $_POST['by'];
$address = $_POST['address'];
$city = $_POST['city'];
$state = $_POST['state'];
$zip = $_POST['zip'];
$email = $_POST['email'];
$comments = $_POST['comments'];
//*********************************************************
//** Message to site owner ******************************
//*********************************************************
$message = "Revision request submitted on $today\n
\n
Requested by: $by\n
Address: $address\n
City: $city\n
State: $state\n
Zip: $zip\n
Email: $email\n
\n
Comments: $comments \n";
//=========================================================
$to = "name@domain.com";
$from = "name@domain.com"; //use in case sender email bad
//$to = "name@domain.com";
//$from = "name@domain.com"; //use in case sender email bad
$subject = "Revision Request - $today";
//========================================================
//mail() function sends the mail
mail($to,$subject, "Revision request submitted on $today\n
\n
Requested by: $by\n
Address: $ADDRESS\n
City: $CITY\n
State: $STATE\n
Zip: $ZIP\n
Email: $EMAIL\n
\n
Comments: $comments \n");
//========================================================
print "done!";
?>
When the script executes, I do see the "Done!" in the browser.
Thanks a lot for your help!
Christian
Andreas
Allen: I added the following code that you mentioned.
echo "<PRE>_POST: ";
print_r ($_POST);
echo "</PRE>";
at the top of the script. Here is the output:
_POST: Array
(
[RECIPIENT] => name@n.com
[SUBJECT] => Request An Appraisal
[BY] => wer
[ADDRESS] => wer
[CITY] => wer
[STATE] => FL
[ZIP] => wer
[EMAIL] => sales@n.com
[COMMENTS] => dfgdfg
[Submit] => Submit
)
done!
It still took me a few minutes, but I then noticed that the variable names are coming in in UPPER CASE!
I changed the script to upper case and it's working!
Thanks to all that contributed and helped with this problem, I spent most of yesterday trying to use the PHP help and trying everything I knew to figure it out. ONce again, it's one of those stinking little details that kills me.
While I enjoy this, it's why I don't do it for a living...!
Thanks again,
Christian
P.S. If anyone has SEO questions, please let me know.