Re: [請益] php網頁會員登入問題
以下是我目前的程式碼!!
<!--範例程式:>
<html>
<head><title>login</title></head>
<body>
<center>
<h2>ID&&PassWord</h2>
<hr><small><font color="red">
<?
session_start();
session_register("login_session");
$ID="";
$Password="";
if(isset($_POST["ID"]))
$ID=$_POST["ID"];
if(isset($_POST["Password"]))
$Password=$_POST["Password"];
if($ID!="")
{
$link=mysql_connect("localhost","sosokill","sosokill");
mysql_select_db("member");
$sql="SELECT * FROM membertest WHERE ID='".$ID."' AND
Password='".$Password."'";
$result=mysql_query($sql);
if(mysql_num_rows($result)>=1){
$_SESSION["login_session"]=true;
header("location:hello.php");
}else
echo "<br>Password error<br>";
mysql_close($link);
}
?>
</font></small></center>
<form action="check.php" method="post">
<table align="center" bgcolor="#FFCC99">
<tr><td>username:</td>
<td><input type="text" name="ID" size="15" maxlength="20"></td></tr>
<tr><td>password:</td>
<td><input type="password" name="Password" size="15" maxlength="20"></td></tr>
<tr><td colspan="2" align="center">
<input type="submit" value="login"></td></tr>
</table>
</form>
</body>
</html>
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.129.39.100
→
08/11 23:48, , 1F
08/11 23:48, 1F
→
08/11 23:48, , 2F
08/11 23:48, 2F
→
08/11 23:52, , 3F
08/11 23:52, 3F
→
08/11 23:53, , 4F
08/11 23:53, 4F
→
08/11 23:54, , 5F
08/11 23:54, 5F
→
08/12 00:14, , 6F
08/12 00:14, 6F
推
08/12 00:15, , 7F
08/12 00:15, 7F
→
08/12 00:16, , 8F
08/12 00:16, 8F
→
08/12 00:24, , 9F
08/12 00:24, 9F
→
08/12 00:24, , 10F
08/12 00:24, 10F
→
08/12 00:25, , 11F
08/12 00:25, 11F
→
08/12 00:25, , 12F
08/12 00:25, 12F
→
08/12 00:25, , 13F
08/12 00:25, 13F
→
08/12 00:26, , 14F
08/12 00:26, 14F
推
08/12 00:26, , 15F
08/12 00:26, 15F
→
08/12 00:27, , 16F
08/12 00:27, 16F
→
08/12 00:30, , 17F
08/12 00:30, 17F
→
08/12 00:30, , 18F
08/12 00:30, 18F
→
08/12 00:36, , 19F
08/12 00:36, 19F
→
08/12 00:43, , 20F
08/12 00:43, 20F
討論串 (同標題文章)
完整討論串 (本文為第 6 之 7 篇):
請益
0
11