0) { $initial = $_GET["p"]; unset($_SERVER['QUERY_STRING']); } if ($initial == 2) { //bin~name,title,format,content $binname = $_POST["binname"]; $bintitle = $_POST["bintitle"]; $binformat = $_POST["binformat"]; $bincontent = $_POST["bincontent"]; if (alive($binname) && alive($bincontent)) { } } $qs = trim(htmlspecialchars($_SERVER['QUERY_STRING'])); $box = trim(htmlspecialchars($_POST["zogibox"])); if (!alive($box)) { $box = $qs; } $del = $_GET["delete"]; $rel = $_GET["release"]; if (alive($del) || alive($rel)) $box = ""; $url = ""; $ipaddress = $_SERVER["REMOTE_ADDR"]; if (alive($box)) { $sql = "SELECT * FROM aliases WHERE Alias = '$box'"; $res = querydb($sql); if (mysql_num_rows($res) == 0 && strpos($box,'.') > 0) { $colon = strpos($box,'://'); $space = strpos($box,' '); $dot = strpos($box,'.'); if ($colon === false) { $box = "http://$box"; } if ($space < $dot) { $overridecode = trim(substr($box,0,$space-1)); $box = trim(substr($box,$space,strlen($box)-$space)); // Allow a name to be given before the first dot :D } $sql = "SELECT * FROM aliases WHERE Link = '$box';"; $res = mysql_query($sql); if (mysql_num_rows($res) > 0) { $url = "zogi.co.uk?" . mysql_result($res,0,"Alias"); message("Short link available at $url."); } else { $code = randomCode(5,""); $ok = false; while (!$ok) { $sql = "SELECT * FROM aliases WHERE Alias = '$code';"; $res = mysql_query($sql); if (mysql_num_rows($res) == 0) { $ok = true; break; } else { if (alive($overridecode)) { $code = $overridecode; $sql = "DELETE FROM aliases WHERE `Alias` = '$code';"; querydb($sql); $ok = true; } else { $code = randomCode(5,""); } } } $now = time(); $sql = "INSERT INTO aliases (`Alias`,`Link`,`IP`,`Datestamp`) VALUES ('$code','$box','$ipaddress','$now')"; querydb($sql); $url = "zogi.co.uk?$code"; message("Short link created at $url."); } } else { if (mysql_num_rows($res) == 0) { message("There is no short link with that alias."); } else { header("Location: " . mysql_result($res,0,"Link")); } } } else { $x = false; if (alive($del)) { $sql = "SELECT * FROM aliases WHERE ID = '$del';"; $res = querydb($sql); $aip = mysql_result($res,0,"IP"); if ($aip == $ipaddress) { $sql = "DELETE FROM aliases WHERE ID = '$del';"; querydb($sql); } $x = true; } else if (alive($rel)) { $sql = "SELECT * FROM aliases WHERE ID = '$rel';"; $res = querydb($sql); $aip = mysql_result($res,0,"IP"); if ($aip == $ipaddress) { $sql = "UPDATE aliases SET `IP` = '' WHERE ID = '$rel';"; querydb($sql); } $x = true; } if ($x) header("Location: index.php"); } ?> Zogi
Welcome to Zogi
$message
"; } $dir = opendir("modules/"); $modules = array(); while (($file = readdir($dir)) !== false) { if ($file != "." && $file != "..") { array_push($modules,$file); } } asort($modules); for ($ix = 0; $ix < count($modules); $ix++) { $ip = $ix + 1; echo "
\n"; include("modules/$modules[$ix]"); echo "\n
\n"; $h = strpos($modules[$ix],"-"); $modules[$ix] = substr($modules[$ix],$h+1); } ?>
Your IP address: