dongyao2001 2019-05-01 10:27
浏览 133

如何使用此PHP登录设置修复too_many_redirects

I have a web server running LAMP. I have the website tbg.robotpidgeon.com set up to run the PHP login system that I copied from here (https://www.tutorialrepublic.com/php-tutorial/php-mysql-login-system.php).

Very basic login system using MySQLi.

In my apache2 config file for this web address, I have set up the virtual host and pointed it to where the PHP files are located. However, when you go to the above address it generates an index of the PHP files.

When I try to set up the virtual host to land on the login or welcome page I get a too_many_redirects error. So I am assuming that I have created a loop when I set the virtual host document root to a specific PHP file?

What should I do so that when I go to the above address it goes to the login/register page?

  • 写回答

1条回答 默认 最新

  • dtby67541 2019-05-01 13:55
    关注

    The browser is stopping you from hammering the server with a bunch of requests. This is most likely due to the header() sending you to a page which in turn sends you to the same page (or page with the same header()).

    In your session.php you have to destroy the session because it might be set still but without that the query can find a existing user?

    To unset sessions do this:

    unset(); for all the session variables unset($_SESSION['login_user']); for a specific session

    评论

报告相同问题?

悬赏问题

  • ¥15 MATLAB动图问题
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题