 |
|
ต่อนะคะ รับค่า
รับค่า โดยที่ยังไม่เช็ค userจาก db ที่ไม่ทราบว่าจะใส่ยังไง
Code
<?
$username = $_POST["username"];
$password = $_POST["password"];
$password2 = $_POST["password2"];
$firstname = $_POST["firstname"];
$lastname = $_POST["lastname"];
$company = $_POST["company"];
$gender = $_POST["gender"];
$day = $_POST["day"];
$month = $_POST["month"];
$year = $_POST["year"];
$email = $_POST["email"];
$address = $_POST["address"];
$country = $_POST["country"];
$postal_code = $_POST["postal_code"];
$tel = $_POST["tel"];
$fax = $_POST["fax"];
$mobile = $_POST["mobile"];
$favourite_color = $_POST["favourite_color"];
$sql = <<<SQL
insert into tbregister values('$username','$password','$password2','$firstname','$lastname','$company','$gender','$day','$month','$year','$email','$address','$country',$postal_code,$tel,$fax,$mobile,'$favourite_color');
SQL;
include "connectdb.php";
include "function.php";
$result=mysql_query($sql);
$msg = "";
$resetForm = "";
if($link==0){
$msg = "<p class='red2' align='center'>";
$msg .= "Sorry, you are not able to be registered.";
echo "<meta http-equiv='refresh' content='5; url=re_cus.php' />";
}
else{
echo "<p class='red2' align='center'>Thank you. You are already registered.</p>";
echo "<meta http-equiv='refresh' content='5; url=service.php' />";
$resetForm = "document.getElementById('myForm').reset();";
}
}
mysql_close($link);
?>
|
 |
 |
 |
 |
Date :
2009-06-30 22:49:50 |
By :
SG14 |
|
 |
 |
 |
 |
|
|
 |