view php/read/sendToFriend.php @ 60:05f29eb72283 default tip

review from DB not working???
author Charlie Root
date Sun, 09 Jun 2019 06:50:44 -0400
parents a67bf725e87b
children
line wrap: on
line source

<?PHP

if( !empty($_POST) ){

	include "db.php";  

	//echo $_POST["xml"];
	//echo print_r($_POST);
	$xml = new SimpleXMLElement(stripslashes($_POST["xml"]));
	
	$email = $xml->Email;
	$firstName = $xml->Firstname;
	$surname = $xml->Surname;
	
	$url = $xml->Url;
	$msg = $xml->Message;
	
	$note = "";
	if($msg != "")
	{
		$note = "------\nNote from $firstName $surname:\n$msg\n------";
	}
	
	$message = "$firstName $surname spotted some book recommendations on YourNextRead.com and thought you should see them.\nHave a look at: $url\n$note";

	$header="from: YourNextRead <noreply@YourNextRead.com>\nContent-Type: text/plain; charset=iso-8859-1";
	$to=$email;
	$subject="[From: $firstName $surname] Book recommendations from YourNextRead...";
	$sentmail = mail($to,$subject,$message,$header);
}
else
{
	echo "Empty Post";
}

?>