天天躁日日躁狠狠躁AV麻豆-天天躁人人躁人人躁狂躁-天天澡夜夜澡人人澡-天天影视香色欲综合网-国产成人女人在线视频观看-国产成人女人视频在线观看

php 模擬POST提交的2種方法詳解

一、通過curl函數(shù)
復(fù)制代碼 代碼如下:
$post_data = array();
$post_data['clientname'] = "test08";
$post_data['clientpasswd'] = "test08";
$post_data['submit'] = "submit";
$url='http://xxx.xxx.xxx.xx/xx/xxx/top.php';
$o="";
foreach ($post_data as $k=>$v)
{
    $o.= "$k=".urlencode($v)."&";
}
$post_data=substr($o,0,-1);
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_URL,$url);
//為了支持cookie
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
$result = curl_exec($ch);

二、通過fsockopen
復(fù)制代碼 代碼如下:
$URL=‘http://xxx.xxx.xxx.xx/xx/xxx/top.php';
$post_data['clientname'] = "test08";
$post_data['clientpasswd'] = "test08";
$post_data['submit'] = "ログイン";
$referrer="";
// parsing the given URL
$URL_Info=parse_url($URL);
// Building referrer
if($referrer=="") // if not given use this script as referrer
$referrer=<PRE class=php name="code">{1}</PRE><BR>
SERVER["SCRIPT_URI"]; // making string from $dataforeach($post_data as $key=>$value)$values[]="$key=".urlencode($value); $data_string=implode("&",$values);// Find out which port is needed - if not given use standard (=80)if(!isset($URL_Info["port"]))$URL_Info["port"]=80;//
 building POST-request:$request.="POST ".$URL_Info["path"]." HTTP/1.1/n";$request.="Host: ".$URL_Info["host"]."/n";$request.="Referer: $referrer/n";$request.="Content-type: application/x-www-form-urlencoded/n";$request.="Content-length: ".strlen($data_string)."/n";$request.="Connection:
 close/n";$request.="/n";$request.=$data_string."/n";$fp = fsockopen($URL_Info["host"],$URL_Info["port"]);fputs($fp, $request);while(!feof($fp)) { $result .= fgets($fp, 128);}fclose($fp);
<PRE></PRE>
<P><BR>
 </P>
<P>Snoopy 類(2)<BR>
sourceforge.NET/projects/snoopy/</P>
<P>http://www.redalt.com/xref/trunk/nav.htm?wp-includes/class-snoopy.php.htm</P>
<P>HTTP類(1,2)</P>
<P>http://www.phpclasses.org/browse/download/1/file/5/name/http.php</P>
<P>PEAR HTTP_Request</P>
<P>http://pear.php.NET/package/HTTP_Request</P>
<P class=akpc_pop>Popularity: 70%</P>
<P> </P>

php技術(shù)php 模擬POST提交的2種方法詳解,轉(zhuǎn)載需保留來源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請第一時間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 男人边吃奶边摸边做刺激情话 | 99精品欧美一区二区三区美图 | 夜色资源站国产www在线视频 | 久久九九有精品国产23百花影院 | 国产欧美日韩视频怡春院 | 国产亚洲精品看片在线观看 | 美女被免费喷白浆视频 | 美女被爆羞羞天美传媒 | 欧美日韩高清一区 | 国产乱码精品一区二区三区四川 | 国产激情视频在线播放 | 精品无人区麻豆乱码无限制 | 性色爽爱性色爽爱网站 | wwww晚晚干 | 羞羞漫画免费漫画页面在线看漫画秋蝉 | 男生J桶进女人P又色又爽又黄 | 一级毛片免费播放 | www.久艹| 护士日本ⅹxxx丰满hd | 大岛优香久久中文字幕 | 高清国产激情视频在线观看 | 日韩久久影院 | 做a爱片的全过程 | 欧美一区二区视频97色伦 | 国产精品久久久久久久久LI无码 | 99视频在线免费观看 | 18 japanese宾馆直播 | 精品国产5g影院天天爽 | 青柠高清在线观看完整版 | 成人影片迅雷下载 | 中国人泡妞xxxxxxxx19 | 99久久香蕉国产线看观看 | 黄色亚洲片 | 973午夜伦伦电影论片 | 国产成人无码精品久久久影院 | 国产成人a v在线影院 | 男人女人边摸边吃奶边做 | 99热久久爱五月天婷婷 | 好满射太多了装不下了视频 | 国产在线播放KKK | 飘雪在线观看免费高清完整版韩国 |