|
|
|
login บนhostจริงไม่ได้ แต่ บนlocalhostไม่มีปัญหาค่ะ ช่วยแนะนำด้วยนะคะ |
|
|
|
|
|
|
|
ต้องเอา code มาให้ดูครับ
แต่น่าจะเป็นปัญหาเร่องส่งค่า get post ถ้าใช้ form ก็ดูว่า form ส่งแบบไหน
|
|
|
|
|
Date :
2011-03-08 13:32:29 |
By :
- - |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
form.html
<form id="form1" name="form1" method="post" action="login.php " target="_parent">
<label>ชื่อที่ใช้ในการเข้าสู่ระบบ: </label>
<input type="text" name="login" />
<br />
<label>รหัสผ่าน:</label>
<input type="password" name="pass" />
<br />
<input type="submit" name="Submit2" class="style4" value=" เข้าสู่ระบบ " />
</form>
login.php
<?
session_start();
if($_POST) {
$login = $_POST['login'];
$pass = $_POST['pass'];
include("dbconn.inc.php");
$sql = "SELECT * FROM User WHERE Username = '$login' AND Password = '$pass';";
$result = mysql_query($sql);
if(mysql_num_rows($result) !=1) {?>
<p><font size=5 color=red>ชื่อผู้ใช้งาน หรือ รหัสผ่านไม่ถูกต้อง</font></p>
<p><font size=5 color=red><a href="javascript: history.back()">ย้อนกลับไปแก้ไข</a></font>
<?
}
else {
$_SESSION['Username'] = mysql_result($result, 0, "Username");
$_SESSION['Password'] = mysql_result($result, 0, "Password");
header("Refresh: 2; url=home.html");
}
exit;
}
?>
|
|
|
|
|
Date :
2011-03-08 14:15:49 |
By :
i don't know |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|