|
|
|
รบกวนช่วยเรื่องระบบสมาชิกครับ อยากให้ช่วยเพิ่มเติมเรื่อง... |
|
|
|
|
|
|
|
อันนี้เป็นหน้า save_register นะครับ
Code (PHP)
<?
mysql_connect("localhost","roots","velefor");
mysql_select_db("phpmydream");
if(trim($_POST["txtUsername"]) == "")
{
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["txtName"]) == "")
{
echo "Please input Name!";
exit();
}
if(trim($_POST["txtSurename"]) == "")
{
echo "Please input Surename!";
exit();
}
if(trim($_POST["txtAddress"]) == "")
{
echo "Please input Address!";
exit();
}
if(trim($_POST["txtEmail"]) == "")
{
echo "Please input Email!";
exit();
}
if(trim($_POST["txtTel"]) == "")
{
echo "Please input Tel!";
exit();
}
if(trim($_POST["txtPcode"]) == "")
{
echo "Please input Pcode!";
exit();
}
$strSQL = "SELECT * FROM member WHERE Username = '".trim($_POST['txtUsername'])."' ";
$objQuery = mysql_query($strSQL);
$objResult = mysql_fetch_array($objQuery);
if($objResult)
{
echo "Username already exists!";
}
else
{
$strSQL = "INSERT INTO member (Username,Password,Name,Surename,Address,Email,Tel,Pcode,Status) VALUES ('".$_POST["txtUsername"]."',
'".$_POST["txtPassword"]."','".$_POST["txtName"]."','".$_POST["txtSurename"]."','".$_POST["txtAddress"]."','".$_POST["txtEmail"]."','".$_POST["txtTel"]."','".$_POST["txtPcode"]."','".$_POST["ddlStatus"]."')";
$objQuery = mysql_query($strSQL);
echo "Register Completed!<br>";
echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"3;URL=ThxMem.php \">";
}
mysql_close();
?>
|
|
|
|
|
Date :
2011-05-08 00:09:34 |
By :
comment |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|