Sorry. Just another quick question. I have the following
foreach($_SESSION as $k => $sess){
$message .= $k.": ".$sess."\
".$emailID."\
";
}
if(mail($to, $subject, $message)){
header("Location: successfulPayment1.html");
}
else {
echo "ERROR!";
}
} else {
echo "ERROR!";
}
Witout the mail function in an if statement, I received the session variables. With it in the if statement, I receive empty variables. Is the if statement interfering with the forelse loop? And is there a way I can do it like i am attempting, because I only want the header if the email was successful.