");
$input = mysql_real_escape_string($input);
return $input;
}
function prepOutputText($text) {
if ($text == null) die("No Input Provided, Aborting\r\n
");
$output = htmlentities(stripslashes($text),ENT_QUOTES);
return $output;
}
if(isset($_GET['l'])) {
$l = $_GET['l'];
$l = input($l);
$sql = "SELECT id, link, shortlink FROM $tbl_name WHERE shortlink='$l'";
$result = mysql_query($sql);
$count = mysql_num_rows($result);
if($count == 1){
while ($row = mysql_fetch_assoc($result)){ // Attempt to pull all data concerning that one user from table
$id = $row['id'];
$link = $row['link'];
$short = $row['shortlink'];
mysql_close();
echo "Redirecting you to your site, please wait...";
$link = prepOutputText($link);
header("location:".$link);
}
}else{
echo "Hmmm... It appears that your link doesn't exist in my database. Try again?";
header("location:http://unps.us/");
}
}
?>