PhpStorm-POST请求不起作用,GET请求在本地主机上执行 [英] PhpStorm - POST request not working, GET request does on localhost
问题描述
使用PhpStorm时,尝试在localhost上执行$ _POST请求时,我希望定向到的可操作功能或页面在$ _POST或$ _REQUEST中均未收到任何数据,但是在执行$ _GET请求时,它将可以正常工作并发送数据.
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页面...
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页面...
test2.php page...
<?php
print_r($_REQUEST);
- PhpStorm 2016.3.2版
- PHP语言级别7.1
- CLI解释器7.1.1
- OS = macSierra
- PhpStorm version 2016.3.2
- PHP language level 7.1
- CLI Interpreter 7.1.1
- OS = macSierra
无论我使用哪种php语言和cli解释器,问题似乎都会影响我
Issue appears to effect me regardless of what php language and cli interpreter I use
推荐答案
问题似乎特定于PhpStorm,因为可以在运行Windows 10的另一台计算机上重现该问题
Problem appears to be specific to PhpStorm as issue can be reproduced on another machine running windows 10
修复
将test.php和test2.php放到我的XAMPP 7.1本地主机目录中时,没有出现该问题,这也解决了将文件放到Windows 10上的WAMP目录中的问题.
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
这篇关于PhpStorm-POST请求不起作用,GET请求在本地主机上执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!