function add_dos_link($link, $target, $title, $method) { require_once $PHP_INCLUDE_PATH . "hash.php"; require_once $PHP_INCLUDE_PATH . "validate.php"; if (isValidURL($link) && isValidURL($target)) { $target = escapeURL($target); $link = escapeURL($link); } else { die("Invalid url entered."); } $title = htmlentities($_POST['title']); if (is_banned_domain($target)) { die("This domain is disallowed."); } $res = exec_query("SELECT * FROM dos_links WHERE link='" . mysql_real_escape_string($link) . "' AND target='" . mysql_real_escape_string($target) . "' AND title='" . mysql_real_escape_string($title) . "' AND use_get=" . $method . ";"); if (mysql_num_rows($res) != 0) { $row = mysql_fetch_assoc($res); return $row['hash']; } else { $hash = calc_new_hash($link . $target . $title); $res = insert_new_entry($hash, $link, $title, $target, $method); return $hash; } }
<?php require_once "../config.php"; require_once $PHP_INCLUDE_PATH . "db_functions.php"; $entry = get_hash_entry($_GET['hash']); if (mysql_num_rows($entry) != 0) { $row = mysql_fetch_assoc($entry); $title = $row['title']; $link = $row['link']; $target = stripslashes($row['target']); $worker = "js/worker.js"; if ($row['use_get'] == 1) { $worker = "js/worker_get.js"; } if (is_banned_domain($target)) { die("Link not found."); } } else { die("Link not found."); } ?> <html><head><title> <?php echo $title . '</title>'; if ($WARNUSERS) { echo '<script>alert("WARNING: you are about to DoS someone. Exit if you don\'t want to.</script>'; } ?>