PHP Script to Validate URL

I have been working to create a moderation tool for one of our project. In this project the members working for the project needs to submit links and snippets of the page. The moderators need to validate the links as many of the news pages are aggregated ones and the page expires after certain period of time.

I created a script which checks if the page is valid or returns a 404 error or any error

function validateURL2($url) {
    if(strlen($url)) {
        $file = @fopen ($url, "r");
        if ($file) {
        return true;
        }
        else return false;
        exit;
    }
    else return false;
}

This function actually checks for any error and returns true

Bookmark and Share

This post was written by:

Kishore Asokan.
About Kishore - I have been working on different online projects for some time now. Making money online is my biggest challenge and to some extend I have succeeded. Visit Kishore Asokan's website to find out more.. Read other articles writtern by Asokan Kishore

Kishore On Digg | Kishore On Twitter | Kishore On Facebook | Kishore On Stumbleupon

Wordpress Plugin For PAP

Related Posts

  • Beach In W-Maldives
  • Click to Play A video taken at the back...
  • Create multiple 125 x 125 Image Ads for your blog using Google Ad Manager
  • I just finished setting up my ads...
  • Can Your Blog’s Post Speak..? Say “YES”
  • Want to convert your written speech into Mp3...
  • Search result analysis, Google, Search engine optimization
  • Today I am starting off the planned study...
  • Did you receive email summons
  • Recently lots of malicious emails are sent saying...

    2 Responses to “PHP Script to Validate URL”

    1. jeroen says:

      Nice post. I\’ll return.<

    2. siri says:

      This is really interesting…especially for bloggers who would like to keep their status updated.

    Trackbacks/Pingbacks


    Leave a Reply

    Free Home Jobs

    Affiliate Panel Login | New Members Sign-up

    Login to this Blog


    My Flickr Photos - See all photos