PHP Classes

PHP One Time URL: Generate URL that only works one time for the user

Recommend this page to a friend!
  Info   View files Example   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum (2)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2016-02-28 (7 months ago) RSS 2.0 feedStarStarStar 51%Total: 311 This week: 4All time: 6,892 This week: 288Up
Version License PHP version Categories
one-time-url 1GNU General Publi...5.0HTTP, PHP 5, Security
Description Author

This class can generate URL that only works one time for the user.

It takes a given URL and stores it in session variables.

The class returns an obfuscated URL using a random key generated by the class that is also stored in session variables.

It can also retrieve the URL retrieving its key from the current request URL.

The class removes the URL and keys from the session variables, so the one time URL does not work anymore.

Applications should redirect the user to the real page URL when the user accesses the one time URL page.

Innovation Award
PHP Programming Innovation award nominee
March 2016
Number 3

Prize: One downloadable e-book of choice by O'Reilly
Some applications have the need to hide real URLs of resources that they link from their Web pages, so only users can access those resources.

This class can generate URLs that only work one time for the user that accessed a given page.

It uses sessions to store hidden URLs. Those URLs are associated with a key, so when a user accesses the page using a URL with a given key, he is redirected to the real URL. After that the key becomes invalid, so nobody else can use that key again.

Manuel Lemos
Picture of Dan From
Name: Dan From <contact>
Classes: 2 packages by
Country: Denmark Denmark
Age: 34
All time rank: 232016 in Denmark Denmark
Week rank: 239 Up3 in Denmark Denmark Up
Innovation award
Innovation award
Nominee: 1x

  Files folder image Files  
File Role Description
Accessible without login Plain text file .htaccess Data .htaccess
Plain text file class.otu.php Class Main class
Accessible without login Plain text file index.php Example example

 Version Control Unique User Downloads Download Rankings  
This week:4
All time:6,892
This week:288Up
 User Ratings  
 All time