d.shankar Posted August 16, 2007 Share Posted August 16, 2007 I have a simple php CURL script that check for a website and displays its response code and prints its source.. Here is the code... <?php $url="www.yahoo.com"; $ch = curl_init(); curl_setopt($ch,CURLOPT_URL, $url); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); curl_setopt($ch,CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch,CURLOPT_FAILONERROR,true); $source = curl_exec($ch); $httpCode = curl_getinfo($ch,CURLINFO_HTTP_CODE); echo "<br>Response:".$httpCode." For ".$url."<br>"; echo $source; curl_close($ch); ?> The above code is 100% error free. I am getting a response code of 200 for www.google.com and i get a response code of 302 for www.gmail.com both seems to be a positive result and not a false positive. Later i analysed that google runs in http whereas gmail runs in https.. thus i get different response codes !! My main problem is " I am unable to capture the source from gmail.com whereas i can able to capture the source for any http protocol sites" Please have a look ! Link to comment https://forums.phpfreaks.com/topic/65201-solved-severe-problem/ Share on other sites More sharing options...
Orio Posted August 16, 2007 Share Posted August 16, 2007 Try setting CURLOPT_SSL_VERIFYPEER to false with curl_setopt(). Orio. Link to comment https://forums.phpfreaks.com/topic/65201-solved-severe-problem/#findComment-325574 Share on other sites More sharing options...
d.shankar Posted August 16, 2007 Author Share Posted August 16, 2007 It worked out well. Thanks a lot. Link to comment https://forums.phpfreaks.com/topic/65201-solved-severe-problem/#findComment-325581 Share on other sites More sharing options...
tibberous Posted August 16, 2007 Share Posted August 16, 2007 That isn't a severe problem, that is your website can't check it's gmail. My gf of five months doesn't like me anymore and I spent the whole night on meetme.hotornot.com, and now I'm going to loose my job -- thats a severe problem. Link to comment https://forums.phpfreaks.com/topic/65201-solved-severe-problem/#findComment-325583 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.