欧美一级色视频,簧片在线免费看,美日韩在线,成人观看网站a,亚洲欧美在线一区二区,欧美操穴,欧美综合专区

龍巖易富通網(wǎng)絡(luò)科技有限公司

龍巖小程序開(kāi)發(fā),龍巖分銷(xiāo)系統(tǒng)

php模擬提交數(shù)據(jù)

2015.09.10 | 644閱讀 | 0條評(píng)論 | php

php利用fsockopen模擬提交數(shù)據(jù),以下舉例是模擬提交龍巖seo留言板 

[php] 

$sock = fsockopen("zhaobake.com", 80, $errno, $errstr, 30); 

if (!$sock) die("$errstr ($errno)\n"); 

$data = "comment=龍巖seo&author=test&email=test@qq.com&url=http%3A%2F%2F0597seo.com&comment_post_ID=374&comment_parent=0&comment_post_ID=374"; 

fwrite($sock, "POST /wp-comments-post.php HTTP/1.0\r\n"); 

fwrite($sock, "Host: zhaobake.com\r\n"); 

fwrite($sock, "Content-type: application/x-www-form-urlencoded\r\n");

fwrite($sock, "Content-length: " . strlen($data) . "\r\n");

fwrite($sock, "Accept: */*\r\n"); 

fwrite($sock, "\r\n"); 

fwrite($sock, "$data\r\n"); 

fwrite($sock, "\r\n"); 

$headers = ""; 

while ($str = trim(fgets($sock, 4096)))     

   $headers .= "$str\n"; echo "\n"; $body = ""; 

   while (!feof($sock))     

      $body .= fgets($sock, 4096); 

   fclose($sock); 

   echo $body; 

[/php]


贊 (

發(fā)表評(píng)論

木里| 河源市| 碌曲县| 宣威市| 龙泉市| 兴仁县| 丹阳市| 资溪县| 通渭县| 宿州市| 玉龙| 社旗县| 锦州市| 威海市| 晋江市| 永清县| 台山市| 宜都市| 孝感市| 安国市| 惠东县| 海原县| 澄江县| 曲靖市| 巨鹿县| 黔西县| 东台市| 专栏| 杭州市| 长阳| 通州区| 大田县| 深水埗区| 威信县| 义马市| 兴宁市| 中西区| 新绛县| 余江县| 嘉黎县| 新竹县|