<?php
/*
url.php

url redirector.
*/

if(!isset($_GET["url"]))
{
	header("Location: index.php");
	exit();
}

require_once("common.inc");

$short = $_GET["url"];

$sql = "SELECT url FROM urls WHERE short = :short";

$h = $db->prepare($sql);

$h->execute(array(":short" => $short));

$data = $h->fetchAll();

$data = $data[0];

header("Location: " . $data["url"]);


?>
