ConfusedOfLife
08-14-2004, 07:16 PM
Hi
I'm trying to read the contents of these sites with CURL but I'm not successful:
www.iranphp.net
www.yahoo.com
www.codingforums.com
The code I'm using is something like this:
$ch = curl_init("http://www.iranphp.net");
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_REFERER, "http://www.yahoo.com");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec($ch);
curl_close($ch);
print $data;
I think they understand somehow that I'm not getting their content by means of a web browser and they block me. How can I get these sites contents? I was mainly trying to work with e-gold and do its automation service, but it said that I can't work with HTTPS because they're not installed on my system. I'm using PHP5 in Windows XP and I don't know how to install HTTPS support, there was nothing like that in php.ini
BTW I don't have this problem with sites like this:
www.baran.ir
www.alachigh.org
These sites are mine! And I knew that I didn't put any prevention method from curl. So, they work, but what about the real sites?!
Is there any tutorial or something that I can learn from? I think my knowlege in working with CURL is too limited.
Thank You
PS: BTW I learned whatever I know (I think that I know!) from this tutorial:
http://www.phpfreaks.com/tutorials/49/0.php
I'm trying to read the contents of these sites with CURL but I'm not successful:
www.iranphp.net
www.yahoo.com
www.codingforums.com
The code I'm using is something like this:
$ch = curl_init("http://www.iranphp.net");
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_REFERER, "http://www.yahoo.com");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec($ch);
curl_close($ch);
print $data;
I think they understand somehow that I'm not getting their content by means of a web browser and they block me. How can I get these sites contents? I was mainly trying to work with e-gold and do its automation service, but it said that I can't work with HTTPS because they're not installed on my system. I'm using PHP5 in Windows XP and I don't know how to install HTTPS support, there was nothing like that in php.ini
BTW I don't have this problem with sites like this:
www.baran.ir
www.alachigh.org
These sites are mine! And I knew that I didn't put any prevention method from curl. So, they work, but what about the real sites?!
Is there any tutorial or something that I can learn from? I think my knowlege in working with CURL is too limited.
Thank You
PS: BTW I learned whatever I know (I think that I know!) from this tutorial:
http://www.phpfreaks.com/tutorials/49/0.php