|
|
|
ขออนุญาติถามนอยนะครับ ผมก็ใส่โค๊ดแก้แล้ว แต่เวลาสมัครสมาชิกทำไมมันขึ้นแปปนี้อะครับ |
|
|
|
|
|
|
|
อันนี้โค๊ดมันครับ
Code (PHP)
<meta http-equiv="Content-Type" content="text/html; charset=utf_8" />
<?
mysql_connect("localhost","root","1234");
mysql_select_db("PHPMYADMIN");
if(trim($_POST["username"]) == "")
{
echo "Please input Username!";
exit();
}
if(trim($_POST["txtPassword"]) == "")
{
echo "Please input Password!";
exit();
}
if($_POST["txtPassword"] != $_POST["txtConPassword"])
{
echo "Password not Match!";
exit();
}
if(trim($_POST["name"]) == "")
{
echo "Please input Name!";
exit();
}
$strSQL = "SELECT * FROM member WHERE Username = '".trim($_POST['username'])."' ";
$objQuery = mysql_query($strSQL);
$objResult = mysql_fetch_array($objQuery);
if($objResult)
{
echo "Username already exists!";
}
else
{
$strSQL = "INSERT INTO member (username,name,date,month,year,age,sex,address,amper,province,zipcode,phone,education,work,name,password,email,signup,status) VALUES('".$_POST["txtUsername"]."',
'".$_POST["username"]."','".$_POST["date"]."','".$_POST["month"]."' ,'".$_POST["year"]."','".$_POST["age"]."','".$_POST["sex"]."' ,'".$_POST["address"]."','".$_POST["province"]."','".$_POST["zipcode"]."', '".$_POST["phone"]."','".$_POST["education"]."','".$_POST["work"]."', '".$_POST["name"]."','".$_POST["txtPassword"]."','".$_POST["email"]."','".$_POST["signup"]."','".$_POST["ddlStatus"]."')";
$objQuery = mysql_query($strSQL);
echo "Register Completed!<br>";
echo "<meta http-equiv='refresh' content='3; url=index.php'>";
}
mysql_close();
?>
Tag : PHP, CakePHP
|
|
|
|
|
|
Date :
2012-11-22 20:10:43 |
By :
mongkon2042 |
View :
946 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 05
|