SESSION不穩定

看板PHP作者 (泡泡蟲蟲)時間19年前 (2006/09/04 02:08), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
請問 我有下列這些檔案 lib.php <? session_start(); function auth(){ if(empty($_SESSION['agree'])){ header('Location:agreement.php'); } } ?> ================================================ agreement.php <html> .... <form action="agree.php" ....> .... </form> .... </html> =============================================== agree.php <? include('lib.php'); if(...){ $_SESSION['agree']='yes'; } header('Location:index.php'); ?> =============================================== index.php <? include('lib.php'); auth(); ?> 有時候填完表單可以正常回到index.php,顯示index.php之後的內容 但大部分時候會一直回到agreement.php 請問可能是什麼原因造成這不穩定的結果? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 221.169.71.109 ※ 編輯: gmobug 來自: 221.169.71.109 (09/04 02:15)
文章代碼(AID): #14-neJxb (PHP)
文章代碼(AID): #14-neJxb (PHP)