|
 |
|
สอบถามหน่อยค่ะทำหน้าสมัครสมาชิก เก็๋บข้อมูลแต่ไม่มีเมลยืนยันให้ user |
|
 |
|
|
 |
 |
|
พอดีดูโคดจาก https://www.thaicreate.com/community/php-member-register-email-activation.html
สมัครสมาชิก บันทึกเข้า database เรียบร้อย แต่ไม่มี Email ส่งไปให้ user ยืนยันเมล ไม่ทราบว่าต้องแก้ยังไงค่ะ
หาหลายรอบแล้ว ไม่รู้ผิดตรงใหน รบกวนหน่อยค่ะ T^T
Code (PHP)
<?
session_start();
include_once "connect.php";
/*if(trim($_POST["txtUsername"]) == "")
{
echo "Please input Username!";
exit();
}
*/
if(trim($_POST["txtPassword"]) == "")
{
echo"<script language='JavaScript'>";
echo"alert('กรุณากรอก Password');";
echo "JavaScript:history.back();";
echo"</script>";
}
if($_POST["txtPassword"] != $_POST["txtConPassword"])
{
echo"<script language='JavaScript'>";
echo"alert('Password ไม่ตรงกัน');";
echo "JavaScript:history.back();";
echo"</script>";
}
if(trim($_POST["txtName"]) == "")
{
echo"<script language='JavaScript'>";
echo"alert('กรุณากรอกชื่อ');";
echo "JavaScript:history.back();";
echo"</script>";
}
if(trim($_POST["txtEmail"]) == "")
{
echo"<script language='JavaScript'>";
echo"alert('กรุณากรอก Email);";
echo "JavaScript:history.back();";
echo"</script>";
}
if($_POST["txtEmail"] != $_POST["txtEmailCon"])
{
echo"<script language='JavaScript'>";
echo"alert('Email ไม่ตรงกัน');";
echo "JavaScript:history.back();";
echo"</script>";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>SHERWOOD CHEMICALS Public Company Limited</title>
<meta name="Description" content="สินค้าป้องกันและกำจัดแมลง สินค้าทำความสะอาด สินค้าสำหรับเด็ก สินค้าแชมพูสุนัข SHERWOOD"/>
<meta name="Keywords" content="สินค้าป้องกันและกำจัดแมลง, สินค้าทำความสะอาด, สินค้าสำหรับเด็ก, สินค้าแชมพูสุนัข, SHERWOOD" />
<meta name="Classification" content="learning" />
<meta name="audience" content="all" />
<meta name="Rating" content="General" />
<meta name="distribution" content="Global" />
<meta name="Author" content="makedesignweb" />
<meta name="allow-search" content="yes" />
<meta name="robots" content="all, index, follow" />
<meta name="revisit-after" content="3 days" />
<link rel="home" href="http://www.naret.co.th/" />
<link rel="shortcut icon" type="image/ico" href="" />
<link rel="stylesheet" href="css/style.css" />
</head>
<body>
<?
$strSQL = "SELECT * FROM tb_member WHERE email = '".trim($_POST['txtEmail'])."' ";
$objQuery = mysql_query($strSQL);
$objResult = mysql_fetch_array($objQuery);
if($objResult)
{
echo"<script language='JavaScript'>";
echo"alert('ชื่อ Email ซ้ำ กรุณาใช้ชื่อใหม่');";
echo"JavaScript:history.back();";
echo"</script>";
}
else
{
$strSQL = "INSERT INTO tb_member (password,name,email,status,tel,fax,address,province,zipcode,SID,active)
VALUES ('".$_POST["txtPassword"]."','".$_POST["txtName"]."','".$_POST["txtEmail"]."','user','".$_POST["txtTel"]."','".$_POST["txtFax"]."','".$_POST["txtAddress"]."','".$_POST["txtProvince"]."','".$_POST["txtZipCode"]."','".session_id()."','No')";
$objQuery = mysql_query($strSQL);
$Uid = mysql_insert_id();
echo"<script language='JavaScript'>";
echo"alert('สมัครเสร็จเรียบร้อย กรุณายืนยันข้อมูลใน Email');";
echo"window.location='index.php';";
echo"</script>";
$strTo = $_POST["txtEmail"];
$strSubject = "Activate tb_member Account";
$strHeader = "Content-type: text/html; charset=windows-874\n"; // or UTF-8 //
$strHeader .= "From: [email protected]\nReply-To: [email protected]";
$strMessage = "";
$strMessage .= "Welcome : ".$_POST["txtName"]."<br>";
$strMessage .= "=================================<br>";
$strMessage .= "Activate account click here.<br>";
$strMessage .= "http://sherwood.makedesignweb.com/activate.php?sid=".session_id()."&uid=".$Uid."<br>";
$strMessage .= "=================================<br>";
$strMessage .= "sherwoodshop.com<br>";
$flgSend = mail($strTo,$strSubject,$strMessage,$strHeader);
}
mysql_close();
?>
</body>
</html>
Tag : PHP

|
|
 |
 |
 |
 |
Date :
2013-09-29 22:36:04 |
By :
angeleye |
View :
879 |
Reply :
7 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
มัน ERROR ตรงใหนบ้างหรือเปล่าครับ
|
 |
 |
 |
 |
Date :
2013-09-29 23:51:45 |
By :
deawx |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
มันไม่ขึ้นอะไรเลยค่ะ
|
 |
 |
 |
 |
Date :
2013-09-30 00:31:26 |
By :
angeleye |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ต่อไปหลาย ๆ ที่จะปฏิเสธการรับอีเมล์จาก Script โดยไม่ผ่าน SMTP ครับ 
|
 |
 |
 |
 |
Date :
2013-09-30 06:02:05 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ใช้ตัวนี้ก็ได้ครับ
ตอนนี้ผมใช้ของ SendGrid.Com ครับได้ฟรีเดือนล่ะ 25,000 ฉบับ เป็นอะไรที่น่าสนใจมาก 
เพราะตอนนี้รู้สึกว่า Server ของตัวเอง ส่งออกแทบจะไม่ค่อยได้แล้ว
|
 |
 |
 |
 |
Date :
2013-09-30 08:52:47 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณสำหรับคำแนะนำค่ะ เดี๋ยวลองทำดูก่อนนะค่ะ ติดปัญหา แล้วจะมาสอบถามใหม่อีกครั้งนะค่ะ ^___^
|
 |
 |
 |
 |
Date :
2013-09-30 10:05:04 |
By :
angeleye |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 03
|