 |
|
// form send
$text = "ABCDEFGHIJKLMNPQRSTUVWXYZ123456789";
$rand = substr(str_shuffle($text),0,15);
#บันทึกข้อมูลลงdatabase แต่กำหนดสถานะเป็น 0 ไว้คือยังไม่verifyและเก็บตัวแปร rand
ไว้เพื่อตรวจสอบและสร้างลิ้งค์
$sql1 = "insert into member_db values('','$username','$password','','$email','','','','','','','$photo' ,$datejoin,'$monthjoin',$yearjoin,'','0','$rand','')";
$result1 = mysql_db_query($dbname,$sql1);
$to = $_Post[email];
$subject="ทดสอบส่งเมล";
$msg= "<a href=http://www.forfanclub.com/index.php?active=$rand >
<font color=#000000 > http://www.forfanclub.com/index.php?active=$rand </font></a>";
$headers = "From: [email protected]\r\n";
$headers.= "MIME-Version: 1.0\r\n";
$headers.= "Content-Type: text/html; charset=windows-874\r\n";
mail("$to","$subject","$msg","$headers");
////// form รับค่า
if(!empty($_GET[active])){
$sqlup="update member_db set active ='1' where code='$code' ";
$resultup=mysql_db_query($dbname,$sqlup);
$_SESSION['verify_user']=$record[id]; //// อาจจะล๊อคอินไปเลยก็ได้ ด้วย sessionแบบนี้
}
เอาแบบง่ายๆ ลองดู ค่ะ
|
 |
 |
 |
 |
Date :
2009-01-13 19:23:54 |
By :
ioff |
|
 |
 |
 |
 |
|
|
 |