Posted about 1 year ago, by Specific

Problem: You have a database of links that you've collected over couple years, however, some of the links in the database do not exists anymore and when clicked show up with a 404 error.

Answer: PHP is advanced enough and has a function called fsockopen(). This function will connect to the host and port we provide - that is, if the host still exists. 

In the following example, we are checking that Zonehacks.com still exists.  If the connection fails, we will let the user know.

Simple. =)

Author Info Comment