$register_globals = (bool) ini_get('register_gobals'); if($register_globals) $ip = getenv(REMOTE_ADDR); else $ip = $_SERVER['REMOTE_ADDR']; $issue = $_REQUEST["issue"]; if(!$ip) $ip = "0.0.0.0"; $conn = mysqli_connect('grimston.startlogicmysql.com', 'grimston_grim', 'ghost4', 'grimston_vault'); if($issue>0) $sql = "SELECT * FROM grimoire WHERE Issue='$issue' LIMIT 1"; else $sql = "SELECT * FROM grimoire ORDER BY Issue DESC LIMIT 1"; $result = mysqli_query($conn, $sql); if($row = mysqli_fetch_assoc($result)){ $grid = $row["GRID"]; if($row["LastIP"] != $ip){ $totalme = $row["Downloads"] + 1; $result = mysqli_query($conn, "UPDATE grimoire SET Downloads=$totalme, LastIP='$ip' WHERE GRID='$grid' LIMIT 1"); } $redirect = $row["Url"]; } print ""; ?>
Redirecting to desired web page.