The biggest blunder I ever made with PHP
- 5 Comment

I was writing a php code to parse images from a particular url . At the begining I used http://www.google.com as a testing url.
When I tested the php code from my local machine (http://localhost) it took time to get data from a remote url (google.com) . So I decided to check this code with my locally testing web page. So i write the code as bellow :
file: index.php
<?php
$content = file_get_contents(”http://localhost/”);
// parse($content);
?>
This is the biggest mistake I made that day. Did you find the mistake ?? Else try this code with your local machine. You can see your big blunder . Not only you, your system also will get hang ..
Because this is the longest recursive call you can call with your web server !!!
Regards
Sajith
5 Comments on this post
Trackbacks
-
TheAnand said:
Hehe….I really thank you for not using my blog as a test url….which would had got me a ton of hits and impressions on adsense!!!!! That is a really expensive mistake in php
July 12th, 2008 at 2:57 pm -
Sajith M.R said:
Hey anand,
Calling an url from file_get_contents never affect your adsense and analytics. Because they are javascript. This call never execute those scripts. Only browsers visit can be counted using your analytics etc stuffsRegards
Sajith. M.RJuly 12th, 2008 at 4:01 pm -
TheAnand said:
Oh, I think that explains why my hosts analytics like webalizer and webstats are showing a higher count than that of analytics. Am I right in taking this as the reason for the problem?
July 12th, 2008 at 4:04 pm -
Binny V A said:
I cannot see any code - all I see is…
file: index.php >>
215185bfd4f7d85644ac3f87b850f03a000
July 12th, 2008 at 9:27 pm -
Sajith M.R said:
Hello Binny, Check now… There was some error
July 14th, 2008 at 3:01 pm




