Page 1 of 1

php cUrl help

Posted: Sun Sep 09, 2007 7:26 am
by spamyboy

Code: Select all

<?php
function openPage($url)
{
$user_agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)";
$header[] = "Content-Type: text/html; charset=utf-8";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_PORT, 80);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
$document = curl_exec($ch);
return $document;
}
echo openPage("cssmania.com");
?>
How cssmania.com reconize my script as not ordinary web client ?
It parse all data Okey, but it changes images & I need to get images, what can I do ?

Posted: Sun Sep 09, 2007 8:16 am
by superdezign
Changes images? What do you mean?

Posted: Mon Sep 10, 2007 10:53 am
by spamyboy
Had problems with chases, neverminde.