예제 #1
0
<?php

require_once 'linkclass.php';
if (isset($_GET['code'])) {
    $s = new mylink();
    $code = $_GET['code'];
    if ($url = $s->getlink($code)) {
        header('Location:{$url}');
        die;
    }
}
header('Location:index.php');
예제 #2
0
<?php

session_start();
require_once 'linkclass.php';
$s = new mylink();
if (isset($_POST['url'])) {
    $url = $_POST['url'];
    if ($code = $s->makecode($url)) {
        $_SESSION['resulte'] = "your new link is <a href=\"http://127.0.0.1/link/{$code}\">http://127.0.0.1/link/{$code}</a>";
    } else {
        $_SESSION['resulte'] = "there is problem";
    }
}
header('Location:index.php');