<head>
<title>ผลการส่งรหัสผ่าน :: สมาชิกเว็บบอร์ด </title>

<meta http-equiv="content-type" content="text/html; charset=windows-874">
<link href="./style.css" rel="stylesheet" type="text/css">
</head>

<body bgcolor=#FFFFE0 background="pic/bg2.gif">
<?
    
include("config.inc.php");
    
// ตรวจสอบว่ามี username หรือไม่
    
mysql_connect($host,$user,$passwd);
    
$sql "select * from webboard_member where User='$Username'";
    
$result mysql_db_query($dbname,$sql);
    
$NRow mysql_num_rows($result);
    
$row mysql_fetch_array($result);
    
    
$Username $row["User"];
    
$Password $row["Password"];
    
$Email $row["Email"];
    
    if(
$NRow==0) {  //เท่ากับศูนย์คือไม่มีสมาชิกนี้อยู่
        
echo "<br><br><font color=red class=size3><b>\n"
        echo 
"<p align=center>$Username 1 ไม่พบข้อมูลที่ต้องการ<br></p></b>\n";
        echo 
"</font><br><br>\n\n";
        exit();
    }
    else{
        
        
$Username=$User;
        
$Password=$Password;
        
$Email=$Email;
    }    

    
//ส่งเมล์บอกรหัสผ่าน
    
$subject ="Password ของคุณสำหรับแก้ไขข้อมูลสมาชิกเว็บบอร์ด";
    
$msg  "คุณสามารถใช้ Username และ Passwoed นี้ เข้าแก้ไขข้อมูลส่วนตัวของคุณ ที่สมาชิกเว็บบอร์ดได้\n\n";
    
$msg .= "Username ::  $Username\n";
    
$msg .= "Password ::  $Password\n\n";
    
    
$from "From: $webmasterEmail\nReply-To: $webmasterEmail\nReturn-Path: $webmasterEmail";

if(
mail($Email $subject $msg $from)) {
    echo 
"<br><br><br><center>\n";
    echo 
"<table width=370 border=0 cellspacing=0 cellpadding=0 bgcolor=#000000>\n";
    echo 
"<tr><td><table width=100% border=0 cellpadding=2 cellspacing=1>\n";
    echo 
"<tr bgcolor=#FFFFCC>\n"
    echo 
"<td align=center><br>\n";
    echo 
"<font color=green class=size3><b>ส่งอีเมล์ถึง <font color=666666>$Email</font> เรียบร้อยแล้ว</b></font>\n";
    echo 
"<br><br>\n";
    echo 
"</td></tr></table></td></tr></table><br>\n";
    echo 
"</center>\n";
} else {
    echo 
"<br><br><br><center>\n";
    echo 
"<table width=370 border=0 cellspacing=0 cellpadding=0 bgcolor=#000000>\n";
    echo 
"<tr><td><table width=100% border=0 cellpadding=2 cellspacing=1>\n";
    echo 
"<tr bgcolor=#FFFFCC>\n"
    echo 
"<td align=center><br>\n";
    echo 
"<font color=red><b>ไม่สามารถส่งเมล์ถึง <font color=666666>$Email</font> ได้ในขณะนี้</b></font>\n";
    echo 
"<br><br>อาจเกิดจากความผิดพลาดบางประการ<br><br>\n";
    echo 
"</td></tr></table></td></tr></table><br>\n";
}

?>
</body>
</html>