Sorry. Just another quick question. I have the following

	foreach($_SESSION as $k => $sess){
	    $message .= $k.": ".$sess."\
	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.

Could you post a bigger chunk of code? Not sure if I understand exactly what you’re trying to say here…

Anyone know why this might be happening?