我遇到問題,無論如何不能輕視。
我有三個文件 - index.php
,admin.php
,post.php
在index.php
我有
<?
session_start();
$_SESSION['login11_error'] = 'yes';
if(verifying username and password here, if they correct)
{
$_SESSION['login11_error'] = 'no';
header('Location: admin.php');
}
?>
在admin.php
我有
<?
session_start();
<form action="post.php" method="post">
...
?>
和finaly在post.php
<?
session_start();
some functions here...
header("location:admin.php");
?>
,但是當它從post.php
重定向到admin.php
失去它的$_SESSION['login11_error']
值。
有什麼想法?
謝謝...
UPDATE
固定。
因爲我只是在這裏顯示腳本的結構,我在我的問題中有一個錯誤。
後PHP是在另一個文件夾,然後index.php文件和admin.php的,它在/folder1/folder1_1/post.php
在post.php中我寫header('Location: http://bs.am/admin.php")
,當我將其更改爲header('Location: ../../admin.php")
它開始工作。
難以理解的行爲對我來說,但工程:)
會話ID傳遞的方式如何? – Gumbo 2010-07-04 19:38:37
@Gumbo對不起?不明白...什麼ID? – Simon 2010-07-04 19:46:38
當我在'post.php'中打印'$ _SESSION [login11_error]'的值時,它顯示正常,所以我無法理解這是什麼問題。 – Simon 2010-07-04 19:56:46