if(!$LinkID) $redirect = "http://www.grimstone-inc.com/index.html"; else{ $register_globals = (bool) ini_get('register_gobals'); if($register_globals) $ip = getenv(REMOTE_ADDR); else $ip = $_SERVER['REMOTE_ADDR']; if(!$ip) $ip = "0.0.0.0"; //make database connection $conn = mysql_connect("grimston.startlogicmysql.com", "grimston_grim", "ghost4"); mysql_select_db("grimston_vault", $conn); //create a query $result = mysql_query("SELECT * FROM links WHERE LinkID = '$LinkID'"); if($result && mysql_num_rows($result) != 0){ $row = mysql_fetch_assoc($result); if($row["LastIP"] != $ip){ $totalme = $row["Visits"] + 1; $result = mysql_query("UPDATE links SET Visits=$totalme, LastIP='$ip' WHERE LinkID='$LinkID' LIMIT 1"); } $redirect = $row["Url"]; } } print ""; ?>
Redirecting to desired web page.