Re: Control Point of Access for certain pages.

From: Date: Sat, 02 Nov 2002 08:08:26 +0000
Subject: Re: Control Point of Access for certain pages.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-122506@lists.php.net to get a copy of this message
in the url pass two (GET) variables: hash and token generate a md5 hash from a secret string and the token (like time())... oh your page with links to pop ups: <? $secret = "Pigs can fly i see"; $token = time(); $hash = md5($secret.$token); ?> On your popup page: <? $secret = "Pigs can fly i see"; if ( md5($secret.$_GET['token']) != $_GET['hash'] ) { echo "I'm reporting you to the police! (Please link correctly)"; exit; } ?> -js Monty wrote: > On a site that uses a popup window to display images, I want to prevent > people from hotlinking directly to the popup page because it just looks like > crap if not sized properly with controls removed. > > But I'm not sure how I can prevent someone from doing this. It appears the > HTTP_REFERER isn't always a reliable way to see if they are entering the > page from another page on your own site. And I'm not using sessions for this > site (it's not necessary). > > So, I'm a little stuck on how I can allow access to a page only from certain > other pages. Has anyone done this with PHP? > > Thanks! > > >

« previous php.general (#122506) next »