Re: [請益] 為何我的session會這樣壓??

看板PHP作者 (ROLL)時間16年前 (2009/06/09 15:53), 編輯推噓2(200)
留言2則, 2人參與, 最新討論串4/4 (看更多)
我在一個檔案php.ini中看到下面的一段 是指會把session存在tmp的資料夾中嗎? ; where MODE is the octal representation of the mode. Note that this ; does not overwrite the process's umask. ;session.save_path = "/tmp" 在我php5的資料夾底下沒有tmp,所以我自己建立了一個 但是並沒有因此就抓到session阿 ※ 引述《clubflymf (clubfly)》之銘言: : 檢查您 php.ini 中 : session.save_path 路徑 : 看一下 : temp檔中php目錄夾 在不在嚕.. : 不在的話 就新建一個吧.. : 話說您這程式... : $password 怎麼看起來像 虛設的 @@ : uid 抓到後 就登入了 ... : ※ 引述《ROCKIT (ROLL)》之銘言: : : 這台電腦的mysql ~php~apache都是最近才安裝的 : : <? : : require("connect.php"); : : $uid = $_POST["uid"]; : : $password = $_POST["password"]; : : $getUser = "select * from user where uid = '$uid'"; : : $resultOfGetUser = mysql_query($getUser); : : if(mysql_num_rows($resultOfGetUser) > 0 ) : : {//登入成功 : : @session_start(); : : session_register("admin"); : : $_SESSION["admin"] = $uid; : : echo $uid; : : echo $_SESSION["admin"]; : : ?> : : <script> : : alert("登入成功!"); : : location.replace("board_list.php"); : : </script> : : <? : : } : : else{ : : ?> : : <script> : : location.replace("login.php?err=1"); : : </script> : : <? : : } : : ?> : : 另一個頁面後,例如:上述登入成功後的board_list.php : : @session_start(); : : echo $_SESSION["admin"]; : : 都沒有輸出任何的值耶....怎麼會這樣 : : 我看我的phpinfo.php中的session support是enable阿 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 218.174.37.208

06/09 16:09, , 1F
分號代表這行註解掉,所以請拿掉分號
06/09 16:09, 1F

06/09 17:10, , 2F
樓上正解..@@
06/09 17:10, 2F
文章代碼(AID): #1ABXJvDB (PHP)
文章代碼(AID): #1ABXJvDB (PHP)