|
|
|
ช่วยดูโค๊ดหน่อยครับ คือเวลาผมจะให้มันเช็คว่าแอคทีพเมลล์อะไรประมาณนั้น แต่มันก้อเล่นเกบเข้าฐานข้อมูลเลยไม่เช็คอะไรรเลย |
|
|
|
|
|
|
|
Code (PHP)
<!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>Untitled Document</title>
<html>
<head>
<title>ThaiCreate.Com PHP & MySQL Tutorial</title>
</head>
<body>
<?
$hostname_connection = "localhost";
$database_connection = "soapkub_bag";
$username_connection = "soapkub_soapkub";
$password_connection = "soaptaii";
$connection = mysql_pconnect($hostname_connection, $username_connection, $password_connection)
or trigger_error(mysql_error(),E_USER_ERROR);
mysql_query( "SET NAMES UTF8" ) ;
if($verify_status=0){
if ((isset($_POST["email"])) && ($_POST["email"] == "postform")) {
$hostname_connection = "localhost";
$database_connection = "soapkub_bag";
$username_connection = "soapkub_soapkub";
$password_connection = "soaptaii";
$connection = mysql_pconnect($hostname_connection, $username_connection, $password_connection)
or trigger_error(mysql_error(),E_USER_ERROR);
mysql_query( "SET NAMES UTF8" ) ;
$arr_a_z = range( "a" , "z" ) ;
$arr_A_Z = range( "A" , "Z" ) ;
$arr_0_9 = range( 0 , 9 ) ;
$arr_a_9 = array_merge( $arr_a_z , $arr_A_Z , $arr_0_9 ) ;
$str_a_9 = implode( $arr_a_9 ) ;
$str_a_9 = str_shuffle( $str_a_9 ) ;
$verify_code = substr( $str_a_9 , 0 , 10 ) ;
$insertSQL = sprintf("INSERT INTO customer (email, verify_code)
VALUES (’%s’, ’%s’, )", $_POST["email"], $verify_code );
mysql_select_db($database_connection, $connection);
$Result1 = mysql_query($insertSQL, $connection) or die(mysql_error());
$to = "<{$_POST['email']}>" ;
$subject = "Verify By Email" ;
$headers = "MIME-Version: 1.0\r\n" ;
$headers .= "Content-Type: text/html; charset=UTF-8 \r\n" ;
$headers .= "From: Admin <[email protected]>\r\n" ;
$body = "<a href=http://www.stevemaddenhandbags.info/verify_by_email.php?
verify_code={$member_verify_code}&email={".$_POST["email"]."}>
คลิกเพื่อยันยัน</a>" ;
@mail($to, $subject, $body,$headers) ;
}}else{
$objConnect = mysql_connect("localhost","soapkub_soapkub","soaptaii") or die("Error Connect to Database");
$objDB = mysql_select_db("soapkub_bag");
$strSQL = "SELECT * FROM customer WHERE email = '".$_POST["email"]."' ";
$objQuery = mysql_query($strSQL);
$objResult = mysql_fetch_array($objQuery);
if($objResult)
{
echo "<script>alert('มีข้อมูลอยู่ในระบบแล้วครับ');</script>";
echo "<script>window.location='index.php';</script>";
exit();
}
else
{
$strSQL = "INSERT INTO customer VALUES ('$dates')";
$strSQL = "";
$strSQL = "INSERT INTO customer ";
$strSQL .="(email,webcam,sex,name,age,country2,province2) ";
$strSQL .="VALUES ";
$strSQL .="('".$_POST["email"]."','".$_POST["webcam"]."','".$_POST["sex"]."' ,'".$_POST["name"]."' ";
$strSQL .=",'".$_POST["age"]."','".$_POST["country2"]."','".$_POST["province2"]."') ";
$objQuery = mysql_query($strSQL);
if($objQuery)
{
echo "<script>alert('ดำเนินการเรียบร้อยแล้วครับ');window.location='index.php';</script>";
exit();
}
else
{
echo "Error Save [".$strSQL."]";
}
}
mysql_close($objConnect);
}?>
</body>
</html>
คือเวลาผมจะให้มันเช็คว่าแอคทีพเมลล์อะไรประมาณนั้น แต่มันก้อเล่นเกบเข้าฐานข้อมูลเลยไม่เช็คอะไรรเลย
Tag : PHP
|
|
|
|
|
|
Date :
2011-01-21 18:54:51 |
By :
คนมึนๆ |
View :
670 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
$strSQL = "SELECT * FROM customer WHERE email = '".$_POST["email"]."' ";
echo $strSQL;
ลองดูว่าอีเมล์ได้ถูกเชคใน SQL ถูกต้องหรือเปล่าน่ะครับ
|
|
|
|
|
Date :
2011-01-21 22:29:24 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|