Пример #1
0
    //print_r($PARCEL);
} else {
    if ($_SERVER['REQUEST_METHOD'] === "GET" && isset($_GET['key'])) {
        $PARCEL = array("error" => "", "url" => "");
        $custom = $_GET['key'];
        $sqli = new mysqli("localhost", "nbaztec", "");
        if ($sqli->connect_error) {
            die('Connect Error (' . $sqli->connect_errno . ') ' . $sqli->connect_error);
        }
        $sqli->select_db("test");
        if ($custom) {
            $r = $sqli->query("SELECT url FROM `urls` AS u INNER JOIN `mapping` AS m ON u.id=m.id WHERE m.key='{$custom}'");
            if ($sqli->errno === 0 && $r->num_rows) {
                $row = $r->fetch_assoc();
                $u = html_entity_decode($row['url']);
                $u = getTargetUrl($DOMAIN_URL, $u);
                // Get final redirected URL/Redirection loop
                //echo "URL: ".$u;
                if ($u) {
                    header("HTTP/1.1 301 Moved Permanently");
                    header("Location: " . $u);
                } else {
                    die("Nice try with the infinite redirection. Here's a <a href='http://upload.wikimedia.org/wikipedia/commons/4/42/Cookie.gif'>cookie</a>.");
                }
            } else {
                die("No such url exists. Perhaps you wish to create one at <a href='{$DOMAIN_URL}'>u.krow.me</a>");
            }
            //print_r($PARCEL);
        }
    }
}
Пример #2
0
    $pageURL .= "://";
    if (!$ssl && $_SERVER["SERVER_PORT"] != "80" || $ssl && $_SERVER["SERVER_PORT"] != "443") {
        $pageURL .= $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . '/linktarget.php';
    } else {
        $pageURL .= $_SERVER["SERVER_NAME"] . '/linktarget.php';
    }
    return $pageURL;
}
//Buffer larger content areas like the main page content
ob_start();
?>
    <h3>Setting up the queue:</h3>
    <ol class="round">
        <li class="one">
            <h5>Write Known User code</h5>
            Add Known User code to the php page. The target php 
            page contains code to extract and persist information about a queue number. </li>
    </ol>
    
	<div><a href="<?php 
echo $queue->getQueueUrl(getTargetUrl());
?>
">Goto Queue</a></div>
	
<?php 
//Assign all Page Specific variables
$body = ob_get_contents();
ob_end_clean();
$title = "Link Queue Configuration";
//Apply the template
include "master.php";