Home  >  Article  >  Backend Development  >  客户端socket发送http POST请求可以触发服务端PHP页面的isset吗?解决思路

客户端socket发送http POST请求可以触发服务端PHP页面的isset吗?解决思路

WBOY
WBOYOriginal
2016-06-13 13:15:00910browse

客户端socket发送http POST请求可以触发服务端PHP页面的isset吗?
我在客户端使用SOCKET发送HTTP的POST请求

POST /send.php HTTP/1.1
Host: www.temp.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6)
Gecko/20050225 Firefox/1.0.1
Content-Type: application/x-www-form-urlencoded
Content-Length: 6
Connection: Keep-Alive

testname=a


www.temp.com/send.php页面如下






if(isset($_POST['submit'])){
if($_POST['testname']=='a'){
//判断处理
}
}
?>

我的疑问是:客户端发送HTTP请求头后,php页面会执行isset($_POST['submit'])并判断testname的内容吗?

------解决方案--------------------
不会!
因为你没有发送 submit 这个变量
------解决方案--------------------
PHP code

<?php //保存post请求的数据
file_put_contents("log.txt", json_encode($_POST));
?>
看看log.txt就知道了 <div class="clear">
                 
              
              
        
            </div>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn