Click to See Complete Forum and Search --> : Question regarding security and accessibility


digital_storm
04-28-2005, 06:36 AM
Hello

I have to make so a visitor just can reach a page if s/he have clicked on a link from another page. I dont own that webpage (where they have clicked the link) so I cant do whatever I want my thought was.....

Is it possible (and secure) to make a algorithm that makes a unique key and then use that key in an urlrequest. Then when the visitor enters my page I controll that key and if it is ok the visitor get given information on that page. What I understand the page that the visitor enters if the key is correct must be in a protected catalogue so it just cant be downloaded or?

Do you thinks this would work? Or do you have any other suggestions to achive this?

Best regards /D_S

scragar
04-28-2005, 07:23 AM
that makes little sense to me, are you talking about the sort of thing the have on gamefaqs where when you "hotlink" to a page you are instead redirected?
that's not hard:
<?
$domain = "www.mysite.com";
if(! preg_match("/^http:\/\/".str_replace(".", "\\.", $domain)."/i", $_SERVER['HTTP_REFERER'])){
if($_SERVER['HTTP_REFERER'] != ""){
echo "please avoid hotlinking to my pages.";
exit;
};
};
?>

abectech
04-28-2005, 07:36 AM
You could grab the HTTP referrer from your page whenever they enter the site. I don’t know if the visitors will always be entering on one page or if they could come in anywhere and still be granted access to that page. Anyway, grab the referrer, if it’s the site you’re talking about give them a session value of true, then on the protected page only show it to people with the value of true for said variable.

digital_storm
04-28-2005, 08:55 AM
Thanks for your help! I'll try your advice

/D_S