Mercurial > hg > ywww
comparison php/read/sendToFriend.php @ 6:077b0a0a3e6d
remaining originals according to dependency walk
| author | Robert Boland <robert@markup.co.uk> |
|---|---|
| date | Thu, 16 Feb 2017 22:29:02 +0000 |
| parents | |
| children | 385ddd7c4b55 a67bf725e87b |
comparison
equal
deleted
inserted
replaced
| 5:55445b456ad0 | 6:077b0a0a3e6d |
|---|---|
| 1 <?PHP | |
| 2 | |
| 3 if( !empty($_POST) ){ | |
| 4 | |
| 5 include "../../../private/db.php"; | |
| 6 | |
| 7 //echo $_POST["xml"]; | |
| 8 //echo print_r($_POST); | |
| 9 $xml = new SimpleXMLElement(stripslashes($_POST["xml"])); | |
| 10 | |
| 11 $email = $xml->Email; | |
| 12 $firstName = $xml->Firstname; | |
| 13 $surname = $xml->Surname; | |
| 14 | |
| 15 $url = $xml->Url; | |
| 16 $msg = $xml->Message; | |
| 17 | |
| 18 $note = ""; | |
| 19 if($msg != "") | |
| 20 { | |
| 21 $note = "------\nNote from $firstName $surname:\n$msg\n------"; | |
| 22 } | |
| 23 | |
| 24 $message = "$firstName $surname spotted some book recommendations on YourNextRead.com and thought you should see them.\nHave a look at: $url\n$note"; | |
| 25 | |
| 26 $header="from: YourNextRead <noreply@YourNextRead.com>\nContent-Type: text/plain; charset=iso-8859-1"; | |
| 27 $to=$email; | |
| 28 $subject="[From: $firstName $surname] Book recommendations from YourNextRead..."; | |
| 29 $sentmail = mail($to,$subject,$message,$header); | |
| 30 } | |
| 31 else | |
| 32 { | |
| 33 echo "Empty Post"; | |
| 34 } | |
| 35 | |
| 36 ?> |
