2017-01-03 81 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 –