URL Verification Tutorial
Written By Ben Kippax ::: http://www.layouts4u.co.uk :::
This tutorial will show you how to verify if a URL exists or if its a 404 error.
Step 1
<p><form action="verify.php" method="get">
URl (Don't include http://) <input type="text" name="url"><br/>
<input type="submit" value="send"><br/>
</form></p>
call this file "form_verify.php"
Step 2
<?
$up = @fsockopen("$url", 80, $errno, $errstr, 30);
if($up)
{
echo "$url Can Be found";
}
else
{
echo "<b>Oops! <br>$url Cant Be Found</b>";
}
?>
Call This file "verify.php"
Now, all you have to do is include form_verify.php in a page or keep it as a stand alone script and just link it. It's as simple as that.
For a working example please go to http://www.sephet.co.uk/tuts/form_verify.php
I Hope you enjoy the tutorial.
Regards,
Ben