始终将我重定向到admin.php [英] Always redirect me to admin.php
问题描述
重复问题,这是我之前提出的问题,现已关闭.我问我的login.php始终将我重定向到admin.php,无论用户将其登录到什么重定向到admin.php,如何防止在同一代码上出现此错误?请帮助我
duplicate issue that was the question i asked before and its closed now. i m asking that my login.php always redirect me to admin.php whatever the user will log on it redirected to admin.php how to prevent this on that same code? Help me please
推荐答案
使用 echo向您的浏览器发送一些消息您的登录名或密码无效";
在调用 header("location:invalid.html");
,因为在发送有效负载后 您无法发送标头信息.
Sending something to the browser with echo"Your Login Name or Password is invalid";
does not make any sense before calling header("location: invalid.html");
because you can't send header information after you send payload.
您应该删除 echo
-Line,否则重定向将不起作用.
You should remove the echo
-Line or the redirect will not work.
除此之外,PHP 5.3不推荐使用 session_register()
,并在5.4中将其删除.只需使用 session_start()
.
In addition to that, session_register()
is deprecated by PHP 5.3 and got removed in 5.4. Just use session_start()
.
这篇关于始终将我重定向到admin.php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!