时间:2021-07-01 10:21:17 帮助过:3人阅读
代码如下:
$url_with_get= "http://api.facebook.com/restserver.php?method=facebook.friends.get&sessi
$post = array('sig'=>12312123234353);
代码如下:
if(function_exists('curl_init'))
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url_with_get);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
}
else
{
$content = http_build_query($post)
$content_length = strlen($content);
$context =
array('http' =>
array('method' => 'POST',
'user_agent' => $user_agent,
'header' => 'Content-Type: ' . $content_type . "\r\n" .
'Content-Length: ' . $content_length,
'content' => $content));
$context_id = stream_context_create($context);
$sock = fopen($url_with_get, 'r', false, $context_id);
$result = '';
if ($sock)
{
while (!feof($sock))
$result .= fgets($sock, 4096);
fclose($sock);
}
return $result;
}
}
以上就介绍了proactive system password reco php 模拟POST|GET操作实现代码,包括了proactive system password reco方面的内容,希望对PHP教程有兴趣的朋友有所帮助。