![]() |
PHP help?
I have a list of urls that I only want to be accessible from 1 specific url, is this the correct php-way to do it. I tested it and it seemed to work...
PHP Code:
|
the hahahaha is = and another =
|
spoofing and such is not a concern, this is a free site and bandwidth usage etc isn't a problem.. I just don't want people to be able to move thru the directories by typing.. as my directory structure is very easily guessable. lol.
|
|
No.. There's a reason though.
anyhow, is *that* a correct PHP-way to do it? also, if I send the users thru a hyperlink say; http://www.URL.com/cgi-bin/script/sc...hecodeisat.php will the original referer be the script or the .shtml page? It 'seemed' to be the .shtml page in my tests, but as I'm a php-n00bie, I have no idea how it really works. |
Depending on how many urls I was going to do, I might do it something like this instead.
<?php $okrefs=array(); $okrefs['http://www.url1.com/page.shtml']=1; $okrefs['http://url1.com/page.shtml']=1; $okrefs['http://www.url2.com/page.shtml']=1; $okrefs['http://url2.com/page.shtml']=1; $ref=strtolower($HTTP_SERVER_VARS['HTTP_REFERER']); if($okrefs[$ref]= =1){ echo("OK"); }else{ echo("Redirect this"); exit(); } ?> But some browsers/surfers will hide the referer so then you can't really do this at all. Is it for admin type purposes? |
Quote:
|
Quote:
|
Quote:
I send them from say http://ww.url.com/page.shtml that page as a hyperlink <a hreF="/cgi-bin/script.cgi?=http://www.urlwiththecode.com>link</A> So basically I send to the cgi-bin page, which in turn sends them to the 'end page'. So which is the referer? The page where user clicks the link, or the cgi-script that redirects them to the right place? |
Quote:
<?php echo("'$HTTP_SERVER_VARS['HTTP_REFERER']'"); ?> There IS another server variables for "redirect" referers as well. Can't remember the name of it right now. |
All times are GMT -7. The time now is 10:08 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123