<html> <head> <title>ThaiCreate.Com Tutorials</title> </head> <body> <?php mysql_connect("localhost","root","root"); mysql_select_db("mydatabase"); $strSQL = "SELECT * FROM member WHERE Username = '".trim($_POST['txtUsername'])."' OR Email = '".trim($_POST['txtEmail'])."' "; $objQuery = mysql_query($strSQL); $objResult = mysql_fetch_array($objQuery); if(!$objResult) { echo "Not Found Username or Email!"; } else { echo "Your password send successful.<br>Send to mail : ".$objResult["Email"]; $strTo = $objResult["txtEmail"]; $strSubject = "Your Account information username and password."; $strHeader = "Content-type: text/html; charset=windows-874\n"; // or UTF-8 // $strHeader .= "From: [email protected]\nReply-To: [email protected]"; $strMessage = ""; $strMessage .= "Welcome : ".$objResult["Name"]."<br>"; $strMessage .= "Username : ".$objResult["Username"]."<br>"; $strMessage .= "Password : ".$objResult["Password"]."<br>"; $strMessage .= "=================================<br>"; $strMessage .= "ThaiCreate.Com<br>"; $flgSend = mail($strTo,$strSubject,$strMessage,$strHeader); } mysql_close(); ?> </body> </html>
ช่วยกันสนับสนุนรักษาเว็บไซต์ความรู้แห่งนี้ไว้ด้วยการสนับสนุน Source Code 2.0 ของทีมงานไทยครีเอท