PHP page, after clicking submit, the page pointed to by the action cannot be opened. What's going on?
SkyRabbit
SkyRabbit 2018-06-13 17:07:09
0
2
1140
环境: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"用户登录失败";
    }
}
?>


SkyRabbit
SkyRabbit

reply all(1)
无忌哥哥

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

  • reply It is in the same level directory, and the situation is the same whether there is "./" in front of it or not.
    SkyRabbit author 2018-06-14 12:01:51
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template