PhpStorm - POST request not working, GET request does on localhost

▼魔方 西西 提交于 2019-12-11 06:09:22

问题


When using PhpStorm, when attempting to do a $_POST request on localhost, the actionable function or page I wish to direct to does not receive any data in either $_POST or $_REQUEST, however when doing a $_GET request, it does work and data is sent.

test.php page...

<!DOCTYPE html>
<html>
<head>
    <title>test</title>
<body>
    <form action="test2.php" method="post">
        <input type="text" name="queryform"/>
        <input type="submit" value="submit"/>
        <hr/>
    </form>
</body>
</html>

test2.php page...

<?php
print_r($_REQUEST);
  • PhpStorm version 2016.3.2
  • PHP language level 7.1
  • CLI Interpreter 7.1.1
  • OS = macSierra

Issue appears to effect me regardless of what php language and cli interpreter I use


回答1:


Problem appears to be specific to PhpStorm as issue can be reproduced on another machine running windows 10

Fix

When placing test.php and test2.php into my XAMPP 7.1 localhost directory, the issue does not appear, this also resolves the issue when placing files into WAMP directory on windows 10



来源:https://stackoverflow.com/questions/42262855/phpstorm-post-request-not-working-get-request-does-on-localhost

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!