Hi dear sirs. Would be short. I have a problem getting a file from net with Curl.
First and interesting when i write in my browser MSIE 6.0 i get the page all right.
but when i'm trying it to like this:
//=================
<?php
echo ( GetCurlPage("
function GetCurlPage ($pageSpec) {
$ch = curl_init();
$user_agent="Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"
;
curl_setopt ($ch, CURLOPT_URL, "$pageSpec"
;
curl_setopt ($ch, CURLOPT_USERAGENT, $user_agent); //i have to make as if i'm MSIE
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$tmp = curl_exec ($ch);
curl_close ($ch);
$tmp = preg_replace('/(?s)<meta http-equiv="Expires"[^>]*>/i', '', $tmp);
return $tmp;
}
?>
//=================
I get nothing but error 404 and frames. Try it yourself if you like this snippet is ready.
And if you will try to get page you will get it with my script.
Do you know what's the problem?
First and interesting when i write in my browser MSIE 6.0 i get the page all right.
but when i'm trying it to like this:
//=================
<?php
echo ( GetCurlPage("
function GetCurlPage ($pageSpec) {
$ch = curl_init();
$user_agent="Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"

curl_setopt ($ch, CURLOPT_URL, "$pageSpec"

curl_setopt ($ch, CURLOPT_USERAGENT, $user_agent); //i have to make as if i'm MSIE
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$tmp = curl_exec ($ch);
curl_close ($ch);
$tmp = preg_replace('/(?s)<meta http-equiv="Expires"[^>]*>/i', '', $tmp);
return $tmp;
}
?>
//=================
I get nothing but error 404 and frames. Try it yourself if you like this snippet is ready.
And if you will try to get page you will get it with my script.
Do you know what's the problem?