Re: [問題] 請問一個關於session的問題
推
219.68.146.134 07/20, , 1F
219.68.146.134 07/20, 1F
→
219.68.146.134 07/20, , 2F
219.68.146.134 07/20, 2F
不過我debug成功,成果如下:
(只是把session_start();搬到最前面就成功了,害我還想了半天....)
==================================================================
<?php
session_start();
session_destroy();
$uid = $_POST['uid'];
$pass = $_POST['pass'];
$link = mysql_connect("localhost","root","mypassword") or die("link失敗");
$db_delected = mysql_select_db("test",$link) or die("db_select失敗");
$sql = "SELECT * FROM user WHERE uid='$uid' AND pass='$pass'";
$result = mysql_query($sql,$link) or die("result失敗");
if(!mysql_num_rows($result)==0)
{
session_register("uid");
session_register("pass");
$_SESSION['uid'] = $uid;
$_SESSION['pass'] = $pass;
echo "type a:".$_SESSION['uid']."登入成功!";
// echo "<script language='javascript'>window.location='member.php'</script>";
}
else
{
echo "type b:帳號密碼錯誤";
}
?>
==================================================================
--
※ 編輯: FT6034 來自: 219.84.148.120 (07/20 21:25)
推
210.85.147.221 07/20, , 3F
210.85.147.221 07/20, 3F
推
140.123.236.148 07/22, , 4F
140.123.236.148 07/22, 4F
Web_Design 近期熱門文章
PTT數位生活區 即時熱門文章