Jul 12 2008

The biggest blunder I ever made with PHP

Blunder I ever made

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

  1. 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
  2. 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 stuffs

    Regards
    Sajith. M.R

    July 12th, 2008 at 4:01 pm
  3. 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
  4. Binny V A said:

    I cannot see any code - all I see is…

    file: index.php >>

    215185bfd4f7d85644ac3f87b850f03a000

    July 12th, 2008 at 9:27 pm
  5. Sajith M.R said:

    Hello Binny, Check now… There was some error

    July 14th, 2008 at 3:01 pm

LEAVE A COMMENT

Subscribe Form

Subscribe to Blog

Sponsors

    Advt on sajithmr.com
    Itslife Online
    Advt on sajithmr.com
    Advt on sajithmr.com

Recent Comments

  • Binny V A: Thanks for the post - love the picture ;-)
  • TheAnand: A lot of people are seeing errors with google video chat….is there any other software which has to be...
  • Alex: Wow, interresting analysis you have done! I’m trying to run GoogleVoiceAndVideoSetup on linux, using...
  • Mella Fitriansyah: Nice plugin, I will try to add this plugin in my blog…
  • Mella Fitriansyah: Nice Info, Sir i will reading your another post success for you

Recent Readers

JOIN MY COMMUNITY!

Recent Posts