homepage Welcome to WebmasterWorld Guest from 54.145.182.50
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
cURL not giving accurate result.
amrish80

5+ Year Member



 
Msg#: 4571024 posted 8:01 am on May 6, 2013 (gmt 0)

hi
i have created the code to check the status of the url enter by the client which check the status is 200 or not, but i return 200 also whether url does not exist please help.
$url="Some url";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
curl_exec($ch);
$retcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $retcode;


Any help will be appreciated.

 

jack13580



 
Msg#: 4571024 posted 6:42 pm on May 6, 2013 (gmt 0)

same problem as me, this is why
(your internet provider) is probably your ISP and when the DNS lookup fails they are hijacking your request and returning their search page.
do a search on "NXDOMAIN response hijacking"

brotherhood of LAN

WebmasterWorld Administrator brotherhood_of_lan us a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



 
Msg#: 4571024 posted 7:24 pm on May 6, 2013 (gmt 0)

I think Jack's on the right path, BT (UK) were doing this and caused me some confusion when I first came across it.

swa66

WebmasterWorld Senior Member swa66 us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4571024 posted 8:36 pm on May 6, 2013 (gmt 0)

If it's that, change your DNS servers to 8.8.8.8 and 8.8.4.4 (both are offered publicly by Google), if it goes away: it's your ISP trying to make money off of your typos.

[edited by: swa66 at 8:36 pm (utc) on May 6, 2013]

jack13580



 
Msg#: 4571024 posted 9:07 pm on May 6, 2013 (gmt 0)

If it's that, change your DNS servers to 8.8.8.8 and 8.8.4.4 (both are offered publicly by Google), if it goes away: it's your ISP trying to make money off of your typos.


that won't work because the isp's got smarter, check out this article
[hackercodex.com...]

amrish80

5+ Year Member



 
Msg#: 4571024 posted 7:22 am on May 7, 2013 (gmt 0)

hi
Thanks for your help.
Can i do the same job using socket programming, will it help to return correct result.



Thanks

brotherhood of LAN

WebmasterWorld Administrator brotherhood_of_lan us a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



 
Msg#: 4571024 posted 12:14 pm on May 7, 2013 (gmt 0)

No. You should read up and understand the above RE: DNS to see why writing your functions using sockets doesn't make a difference.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved