search

Home  >  Q&A  >  body text

PHP page, after clicking submit, the page pointed to by the action cannot be opened. What's going on?

环境:PHPStorm 2018.1+Wampserver 3.1
打开单个页面没问题,但点击提交按钮后,显示“无法找到该网页”。
而在无法找到网页的窗口直接刷新网页,又可以访问。

index.php:
<form action="./check.php" method="post">
用户登录
<br>
用户名:<input type="text" name="uname"><br>
密码:<input type="password" name="upwd"><br>
<input type="submit" value="提交">
<input type="reset" value="重置">
</form>

check.php:
<?php
if(isset($_POST)){
    if($_POST['uname'] == 'admin' && $_POST['upwd'] == 'admin'){
        echo"用户登录成功";
    }else{
        echo"用户登录失败";
    }
}
?>


SkyRabbitSkyRabbit2363 days ago1110

reply all(2)I'll reply

  • 无忌哥哥

    无忌哥哥2018-06-14 10:58:02

    It seems that there is something wrong with the address submitted by the action. Try changing it to the same level directory.

    reply
    0
  • SkyRabbit

    It is in the same level directory, and the situation is the same whether there is "./" in front of it or not.

    SkyRabbit · 2018-06-14 12:01:51
  • Cancelreply