日期:2014-05-17 浏览次数:20465 次
$url="http://110.75.65.8/search_turn_page_iphone.htm?sort=&q=liz claiborne&page=1&showMode=list";
echo Post($url);
function Post($url, $post = null)//请求的网页
{
$context = array();
if (is_array($post))
{
ksort($post);
$context['http'] = array
(
'timeout'=>60,
'method' => 'POST',
'header'=>">Accept-language: en/r/n",
'content' => http_build_query($post, '', '&'),
);
}
return file_get_contents($url, false, stream_context_create($context));
}
Warning: file_get_contents(http://110.75.65.8/search_turn_page_iphone.htm?sort=&q=liz claiborne&page=1&showMode=list) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: HTTP request failed! HTTP/1.1 505 HTTP Version Not Supported in F:\wwwroot\getTaobao\test.php on line 25