2017-01-03 83 views
-1

我正在做一個登錄和註冊系統,但我的頭重定向不能正常工作而不是重定向我到我home.php頁面上登錄它把我送到我的index.php。PHP的標題( 「位置:home.php」);不重定向我正確

這裏是代碼:

$_SESSION["user_login"] = $user_login; 
header("Location: home.php"); 
    exit(); 
} else { 
    echo 'That information is incorrect, try again'; 
    exit(); 

爲什麼形式操作設置爲的index.php但是當我將其更改爲home.php發送我有,但不記錄我 這裏是形式代碼:

<form action="index.php" method="POST"> 
    <input type="text" name="user_login" size="25" placeholder="Username" /><br /><br /> 
    <input type="text" name="password_login" size="25" placeholder="Password" /><br /><br /> 
    <input type="submit" name="login" value="Login"> 
</form> 
+0

能否請您添加完整的index.php代碼 –

+0

[HTML5的佔位符屬性是不是爲標籤元素的替代品(http://www.456bereastreet.com/archive/201204/the_html5_placeholder_attribute_is_not_a_substitute_for_the_label_element/),因爲出口 – Quentin

回答

-2
exit(); 

終止程序,因此將其刪除,然後再試一次。

+0

();你不會知道它是否重定向到該鏈接或沒有。 –

+0

這更糟 –

+0

呀它仍然重定向我不工作的index.php –