PHP;">
$o = "";
foreach ( $post_data as $k => $v )
{
$o.= "$k=" . urlencode( $v ). "&" ;
}
$post_data = substr($o,-1);
$key=md5(base64_encode($post_data));
if($ispost){
$url=$url;
}else{
$url = $url.'?'.$post_data;
}
$curlPost = 'key='.$key;
header("Content-type: text/html; charset=utf-8");
$ch = curl_init();//初始化curl
curl_setopt($ch,CURLOPT_URL,$url);//抓取指定网页
curl_setopt($ch,CURLOPT_HEADER,0);//设置header
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);//要求结果为字符串且<a href="/tag/shuchu/" target="_blank" class="keywords">输出</a>到屏幕上
if($ispost){
curl_setopt($ch,CURLOPT_POST,1);//post提交方式
curl_setopt($ch,CURLOPT_POSTFIELDS,$curlPost);
}
$data = curl_exec($ch);//运行curl
curl_close($ch);
return $data;
}
?>
PHP;">
}
testAction();
?>
testAction();
?>
PHP;">
'huanglu','password'=>'123456');
echo json_encode($arr);
}else{
exit('非法访问!');
}
}
serverapi();
?>