hello! i have some kind of link redirector and i have piece of code that looks like this:
if ($action == go) {
$sql = mysql_query("UPDATE links SET hits='$hits'+1 WHERE id='$id'");
header("Location: http://" . $selected_link . "");
}
now i wonder if i can detect somehow if '404 error' is displayed and if it is then redirect user to other page?