PHP Classes

File: redir.php

Recommend this page to a friend!
  Classes of Chouchen  >  PHP Short URL Generator  >  redir.php  >  Download  
File: redir.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Short URL Generator
Create short URLs storing them in a XML database
Author: By
Last change:
Date: 1 year ago
Size: 358 bytes


Class file image Download
 * Redirecting file
 * Take the name in the url and redirect if it's in the DB

$url = new ShortURL();

$name = $_GET['name'];

$_SESSION['msg'] = '';

$ret = $url->findThisUrl($name);

$ret == null){
header("Location: 404.html");
header("Location: ".$ret[0]);

For more information send a message to info at phpclasses dot org.