PHP reading a page on my site

millen

New Member
I'm trying to open read a page on my own website for a search engine I'm trying to get working.I've tried several ways of doing it:
file_get_contents \[code\]$temp = file_get_contents("http://www.mysite.com/example01/");echo $temp;\[/code\]returns:\[quote\] Warning: file_get_contents(http://www.mysite.com/example01/) [function.file-get-contents]: failed to open stream: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in C:\inetpub\wwwroot\mysite\example01\temp.php on line 66\[/quote\]curl\[code\]function curl($url){ $ch = curl_init($url); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, true); // Display headers curl_setopt($ch, CURLOPT_VERBOSE, true); // Display communication with server curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); print "<pre>\n"; print_r(curl_getinfo($ch)); // get error info echo "\n\ncURL error number:" .curl_errno($ch); // print error info echo "\n\ncURL error:" . curl_error($ch); print "</pre>\n"; return curl_exec($ch); curl_close($ch);}$temp = curl("http://www.mysite.com/example01/");echo "'$temp'";\[/code\]returns:\[quote\] Array ( => [url]http://www.jlwarranty.com/example01/ [http_code] => 0 [header_size] => 0 [request_size] => 0 [filetime] => 0 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 0 [namelookup_time] => 0 [connect_time] => 0 [pretransfer_time] => 0 [size_upload] => 0 [size_download] => 0 [speed_download] => 0 [speed_upload] => 0 [download_content_length] => 0 [upload_content_length] => 0 [starttransfer_time] => 0 [redirect_time] => 0 ) cURL error number:0 cURL error: ''\[/quote\]it takes about 30 seconds to get the page to reload.cURL is enabled in php.ini, and so is allow_url_fopen.
 
Back
Top