News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PHPMaster.com:
Generating One-Time Use URLs
April 10, 2013 @ 11:18:56

On PHPMaster.com there's a new tutorial posted showing you how to generate one-time use URLs that could be used for various things across an application, including things like account verification links.

A one-time URL is a specially crafted address that is valid for one use only. It's usually provided to a user to gain privileged access to a file for a limited time or as part of a particular activity, such as user account validation. In this article I'll show how to generate, implement, and expire one-time URLs.

Included in the post is the SQL to create a sample "pending_users" table that includes a "token" column for storing the generated hash. Code is also included for generating the hash and checking the incoming URL to see if it matches the requested user (and hasn't expired).

As a matter of general house keeping you could write a secondary script to keep expired tokens from accumulating in the database if a user never follows them. The script could be run periodically by an administrator, or preferably set up as a scheduled task or cron job and run automatically.
0 comments voice your opinion now!
onetime url tutorial generate unique

Link: http://phpmaster.com/generating-one-time-use-urls

blog comments powered by Disqus

Similar Posts

DevShed: Handling Entries for a Blogger Built with PHP

Evan Coury's Blog: Using Zend\Dbs TableGateway & HydratingResultSet to return rows as custom enties

Zend Developer Zone: Generating and Validating Web Forms With PEAR HTML_QuickForm

HowToForge.com: Loops In PHP

Dave Marshall' Blog: Asynchronous cache priming with progress bars via Gearman, Memcache and Dojo


Community Events





Don't see your event here?
Let us know!


deployment community package framework symfony api unittest laravel introduction series library zendserver voicesoftheelephpant interview language opinion release install podcast bugfix

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework