2016-11-08 47 views
1

我正在为管理面板创建登录菜单。登录菜单被称为login.php,但后来我将其更改为index.php。我将行动从login.php更改为index.php,但是当我点击登录按钮时,它仍然会去login.php,这不存在。为什么此表单重定向到错误的文件?

<form action="index.php" method="POST" autocomplete="off"> 
    <table> 
     <tr> 
      <td> 
       Username: 
      </td> 
     </tr> 
     <tr> 
      <td> 
       <input type="text" name="username" placeholder="Username"> 
      </td> 
     </tr> 
     <tr> 
      <td> 
       Password: 
      </td> 
     </tr> 
     <tr> 
      <td> 
       <input type="password" name="password" placeholder="password"> 
      </td> 
     </tr> 
     <tr> 
      <td> 
       <input type="submit" name="login" value="Login"> 
      </td> 
     </tr> 
    </table> 
</form> 
+1

缓存问题?当然,你正在保存并使用正确的文件? (在浏览器中查看控制台/代码视图)。在浏览器中清空缓存,或尝试使用其他浏览器,并查看会发生什么 – junkfoodjunkie

+1

听起来像是Cookie问题。如果您使用的是Chrome,则可以按Ctrl + Shift + F5进行页面的硬刷新。 –

+0

我使用正确的文件,因为如果我改变我的登录表单中的东西,我直观地看到更改。当我设置我的行动为例如注册页面

它加载注册页面。但是,当我将其更改回索引时,它会尝试加载login.php – f0cus

回答

-3

关闭浏览器,重启服务器,然后尝试导航到同一页面并提交表单。它会工作。

+0

已删除Chrome和缓存上的所有历史记录。 XAMPP重新启动。仍然形式去login.php。 Omg我我将我的表单重命名为login.php,它试图加载index.php – f0cus

+0

所有不错,将表单动作更改为login.php并且工作正常。但是如果文件名是索引仍然会登录。 – f0cus

+0

我不再理解这里有点疯了,形式被称为inde.php与,我创建了空的login.php文件,现在它重定向到空登录。 PHP文件? – f0cus

-1
<form id="Rform" method="post" action="authentication.php"> 
    <!-- Your input tags etc --> 
    <!-- 'authentication.php' file to which redirect --> 
</form> 

如果您仍然有错误或删除以前的文件'login.php',重新创建文件'index.php'。

0

我重新创建我的表单,现在它完美地工作,感谢帮助家伙!

相关问题