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
WordPress Tags: url validator

{ 2 comments… read them below or add one }
Nice post. I\’ll return.<
This is really interesting…especially for bloggers who would like to keep their status updated.