您好,欢迎访问一九零五行业门户网

关于PHP的POST请求问题

比如访问一个网址 http://localhost/api/
对应的目录和文件应为 e:\www\api\index.php,因为apache设置了directoryindex index.php,默认访问index.php。
通过get请求这个网址 $_server['request_method'] 为get,
但是通过post请求这个网址 $_server['request_method'] 还是为get而且得不到传输的值,
最后修改如下网址http://localhost/api/index.php,post请求才得以访问,请教一下这个是什么原因呢?
回复内容: 比如访问一个网址 http://localhost/api/
对应的目录和文件应为 e:\www\api\index.php,因为apache设置了directoryindex index.php,默认访问index.php。
通过get请求这个网址 $_server['request_method'] 为get,
但是通过post请求这个网址 $_server['request_method'] 还是为get而且得不到传输的值,
最后修改如下网址http://localhost/api/index.php,post请求才得以访问,请教一下这个是什么原因呢?
你是通过是什么方式提交的,我试了一下没问题的哈!
apache的设置只是给浏览器请求的时候给他一个默认首页 在post的时候并没有将参数转发给index.php 如果要转发 可以开启apache的重写模块
其它类似信息

推荐信息