PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of Dan From   PHP One Time URL   index.php   Download  
File: index.php
Role: Example script
Content type: text/plain
Description: example
Class: PHP One Time URL
Generate URL that only works one time for the user
Author: By
Last change:
Date: 8 years ago
Size: 589 bytes
 

Contents

Class file image Download
<?php
session_start
();
require_once
'class.otu.php';

$onUrl = OTU::getOnUrl(); // Splits by ? on REQUEST_URI and returns the first part.
$realUrl = OTU::getRealUrl($onUrl); // Returns the real url, if valid.
$url = '/url/that/needs/to/be/hidden'; // The url that needs to be hidden
$obs = OTU::getObfuscatedUrl($url); // The obfuscated url

echo "Currently on: {$realUrl} <br />";
echo
"<a href=\"{$obs}\">Link</a><br /><br />";

if (!
is_null($realUrl)) {
  echo
"Reloads in 3 seconds";
  echo
'<script>window.setTimeout(function() {location.reload();}, 3000);</script>';
}