1
0
mirror of https://github.com/Chouchen/shorturl.git synced 2018-06-07 06:34:38 +02:00
shorturl/redir.php

23 lines
358 B
PHP
Raw Permalink Normal View History

2010-12-23 12:26:25 +01:00
<?
2011-02-14 17:49:52 +01:00
/**
*
* Redirecting file
* Take the name in the url and redirect if it's in the DB
*/
2010-12-23 12:26:25 +01:00
session_start();
include 'class/ShortURL.php';
$url = new ShortURL();
$name = $_GET['name'];
$_SESSION['msg'] = '';
$ret = $url->findThisUrl($name);
if($ret == null){
header("Location: 404.html");
}else{
header("Location: ".$ret[0]);
}