PHP Post data with Fsockopen

前端 未结 10 1536
梦如初夏
梦如初夏 2020-12-01 15:20

I am attempting to post data using fsockopen, and then returning the result. Here is my current code:



        
10条回答
  •  既然无缘
    2020-12-01 15:51

    Nice one Tamlyn, works great!

    For those that also need to send get vars along with the url,

    //change this:
    
    fwrite($fp, "POST /reposter.php HTTP/1.1\r\n");
    
    //to:
    
    $query = 'a=1&b=2';
    fwrite($fp, "POST /reposter.php?".$query." HTTP/1.1\r\n");
    

提交回复
热议问题