We have 2 pages of php files. The first page gather the email address from the customer. The second page is the one that sends us the order email. I am not sure why we are not receiving the email. The thank you pages, are working correctly though.
Start by doing some basic debugging such as var_dump()-ing each of the variables used in the mail() function parameters to make sure they have the expected values (e.g.: is $emailadr actually set anywhere in the 2nd file?). If that looks OK, then try a very simple script that just sends an email using the same mail() settings and representative test parameters to see if its a mail configuration problem.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Yeah I think the problem is the variable emailadr. I thought I did it correctly on the top of the 2nd file, code posted above. I don't know how to do var_dump()-ing, lmao. I thought using:
$_SESSION['emailadr'] = $emailadr;
on the second file is making the variable $emailadr from the first file?
Any session values in the 2nd file will be in the $_SESSION array (unless you have the deprecated register_globals option is in effect). So you will need to populate $emailadr in the 2nd script from $_SESSION['emailadr'], or just use $_SESSION['email_adr'] instead of $emailadr. (And in the first file you will need to assign $emailadr to the $_SESSION array after you get the value from the form input.)
var_dump() is just a PHP function that outputs the type and value of the specified variable, e.g.:
PHP Code:
$foo = 'bar'; echo "The current value of \$foo is:<br />\n"; var_dump($foo);
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Yes, you have to grab the value from $_SESSION['emailadr']. The $emailadr variable will not automatically be created from it (again, this assumes you are not running with register_globals enabled, which you should not since it is deprecated and will not be available at all in PHP6).
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Bookmarks