<?
$mto = $_POST["mto"];
$msubj = $_POST["msubj"];
$mfrom = $_POST["mfrom"];
$message = $_POST["message"];
$redirect = $_POST["redirect"];
$photo = $_POST["photo"];
if (empty($redirect)) { $redirect = "sndcard.php"; }
if (empty($mto) || empty($msubj) || empty($mfrom) || empty($message) || $mfrom == "sender@xxx.com" || $mto == "receiver@xxx.com") {
echo "<body bgcolor=#ffffdd topmargin=0 leftmargin=0>";
echo "<table width=100% bgcolor=black><td><font face=impact color=red size=6>Send card service of YONOK college</font></td></table>";
echo "<font face=fixedsys size=0><table width=95% align=center><tr><form action=sndcard.php method=post><td bgcolor=#dddddd>";
echo "From : <input name=mfrom size=30 value=sender@xxx.com> EX. webmaster@lampang.net</td></tr><tr><td bgcolor=white>";
echo " To : <input name=mto size=30 value=receiver@xxx.com> EX. kyoko@education.com</td></tr><tr><td bgcolor=#dddddd>";
echo "Subject : <input name=msubj size=50 value='ภาพสวย ๆ จากวิทยาลัยโยนก'></td></tr><tr><td bgcolor=#ffffdd>";
echo "<table width=100%><td valign=top><table align=center border=1 bordercolor=white cellpadding=0><td>";
echo "<input type=radio name=photo value=165.jpg checked><img src=http://www.yonok.ac.th/wallpic/wyn165t.jpg><br>";
echo "<input type=radio name=photo value=166.jpg><img src=http://www.yonok.ac.th/wallpic/wyn166t.jpg><br>";
echo "</td><td>";
echo "<input type=radio name=photo value=167.jpg><img src=http://www.yonok.ac.th/wallpic/wyn167t.jpg><br>";
echo "<input type=radio name=photo value=168.jpg><img src=http://www.yonok.ac.th/wallpic/wyn168t.jpg><br>";
echo "</td><td>";
echo "<input type=radio name=photo value=169.jpg><img src=http://www.yonok.ac.th/wallpic/wyn169t.jpg><br>";
echo "<input type=radio name=photo value=170.jpg><img src=http://www.yonok.ac.th/wallpic/wyn170t.jpg><br>";
echo "</td></table></td><td bgcolor=#dddddd valign=top>";
echo "Messages:<br><textarea name=message rows=10 cols=40>";
echo "</textarea><br><input type=submit value=Send_mail><input name=redirect type=hidden value=". $redirect ."></td></table></td></tr>";
echo "</form></table>";
$message = "hi\nthis is test\nthis is line.";
$mto = "burin@yonok.ac.th";
$msubj = "the subject";
$mfrom = "burin@thaiall.com";
} else {
$message = "<pre>".$message."\n<img src=http://www.yonok.ac.th/wallpic/wyn". $photo .">";
$message = $message."\n\nService from http://".$_SERVER["HTTP_HOST"].$_SERVER["SCRIPT_NAME"];
$message = $message."\n<hr>Script developer by webmaster@yonok.ac.th";
$message = $message."\nIP address : ".$_SERVER["REMOTE_ADDR"]."</pre>";
$msubj = "บริการส่งการ์ด ".$msubj;
$txtfrom = "From: ". $mfrom. "\r\n";
$txtfrom = $txtfrom ."Reply-To: $mfrom\r\n";
$txtfrom = $txtfrom ."MIME-Version: 1.0\r\n";
$txtfrom = $txtfrom ."Content-Type: text/html;\r\n";
$txtfrom = $txtfrom ."Content-Transfer-Encoding: 7bit\r\n";
$txtfrom = $txtfrom ."X-Priority: 1\r\n";
$txtfrom = $txtfrom ."X-Mailer: PHP/" . phpversion();
mail($mto, $msubj, $message, $txtfrom );
echo "<html><head><meta http-equiv=Refresh CONTENT='50; URL=$redirect'>";
echo "</head><body><font face=fixedsys>";
echo "Your message sending [ <b>completely</b> ]<hr color=red><pre>";
echo "From : $mfrom \n";
echo "To : $mto \n";
echo "Subject : $msubj \n";
echo "Message : $message</pre>";
}
?>
จำนวน : 56 บรรทัด