http_referer question for DB access

http_referer question for DB access

am 11.01.2006 22:18:03 von Chris Payne

------=_NextPart_000_0004_01C616CA.99996690
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit

Hi there everyone,



I have a system which dynamically creates a template based website which can
be turned on or off by a switch, to access it a user would do
http://www.websitename/templatename and then it would produce a 404 (NOT
look for a dir as this allows me to use a DB switch to enable the system).
However, when they enter a similar URL as the above it DOES redirect using:



ErrorDocument 404 /redirect.php



BUT the PHP page it redirects to, which has the following code:






echo $_SERVER['HTTP_REFERER']



?>



DOESN'T show the referrer page and I MUST have that in order to find what
template they are aimining to look at. I can't query my MySQL DB without
this information, am I doing something wrong? I did it once before about a
year ago but no longer have the code and I SWEAR I did it this way.



Any help would really be appreciated.



Chris


------=_NextPart_000_0004_01C616CA.99996690--

RE: http_referer question for DB access

am 12.01.2006 01:02:54 von Bastien Koert

I would suspect that you had a default template if there is no referer


$template = "default_template.php"; //or whatever you use to call it

if (!empty($_SERVER['HTTP_REFERER'] )) $template = $_SERVER['HTTP_REFERER']
;

.....

?>

bastien

>From: "Chris Payne"
>To:
>Subject: [PHP-DB] http_referer question for DB access
>Date: Wed, 11 Jan 2006 16:18:03 -0500
>
>Hi there everyone,
>
>
>
>I have a system which dynamically creates a template based website which
>can
>be turned on or off by a switch, to access it a user would do
>http://www.websitename/templatename and then it would produce a 404 (NOT
>look for a dir as this allows me to use a DB switch to enable the system).
>However, when they enter a similar URL as the above it DOES redirect using:
>
>
>
>ErrorDocument 404 /redirect.php
>
>
>
>BUT the PHP page it redirects to, which has the following code:
>
>
>
> >
>
>
>echo $_SERVER['HTTP_REFERER']
>
>
>
>?>
>
>
>
>DOESN'T show the referrer page and I MUST have that in order to find what
>template they are aimining to look at. I can't query my MySQL DB without
>this information, am I doing something wrong? I did it once before about a
>year ago but no longer have the code and I SWEAR I did it this way.
>
>
>
>Any help would really be appreciated.
>
>
>
>Chris
>

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php