RE: [PHP] $HTTP_REFERER?
| From: | Wee Chua | Date: | Wed, 06 Dec 2000 22:07:39 +0000 |
| Subject: | RE: [PHP] $HTTP_REFERER? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-28995@lists.php.net to get a copy of this message | ||
Hi,
I just need to set the HTTP_REFERER of the 1st page as constant value, so I
could use it in the later page. Could anyone help? Thanks
-----Original Message-----
From: Cynic [mailto:cynic@mail.cz]
Sent: Wednesday, December 06, 2000 4:22 PM
To: Wee Chua; PHP (E-mail)
Subject: RE: [PHP] $HTTP_REFERER?
This works on my server:
function ref_check()
{
if(
isset( $GLOBALS['HTTP_SERVER_VARS']['HTTP_REFERER'] )
&&
$GLOBALS['HTTP_SERVER_VARS']['HTTP_HOST']
!= substr( $GLOBALS['HTTP_SERVER_VARS']['HTTP_REFERER'] , 7
,
strlen( $GLOBALS['HTTP_SERVER_VARS']['HTTP_HOST'] )
)
) {
echo "from outside, let's store the referer." ;
} elseif( ! isset( $GLOBALS['HTTP_SERVER_VARS']['HTTP_REFERER'] ) )
{
echo "without a referer, either they typed the URL in the
address bar, used a bookmark, or their UA doesn't
send this information" ;
} ;
} ;
Well, you could probably carry it in the request uri, but your
URLs will look ugly, and you'll need to make sure you don't use
the wrong variable when they use a bookmark...
Sessions is the only reasonable solution I can imagine.
At 21:40 6.12. 2000, Wee Chua wrote the following:
--------------------------------------------------------------
>Hi,
>You got my idea, I have tried your suggestion and it didn't work. Plus, I
am
>not using session. Is there any ways I could do it differently with same
>purpose? Thanks!
>
>-----Original Message-----
>From: Cynic [mailto:cynic@mail.cz]
>Sent: Wednesday, December 06, 2000 3:32 PM
>To: Wee Chua; PHP (E-mail)
>Subject: Re: [PHP] $HTTP_REFERER?
>
>
>sorry, I should have written $HTTP_SERVER_VARS["HTTP_REFERER"] ,
>not $HTTP_SERVER_VARS["PHP_SELF"]
>
>At 21:30 6.12. 2000, Wee Chua , "PHP (E-mail)" <php-general@lists.php.net>
>wrote the following:
>--------------------------------------------------------------
>>you mean you want to store the URL of the page through which
>>a visitor reaches your site? you could use sessions. check for
>>$HTTP_SERVER_VARS["HTTP_REFERER"] , if it's set and doesn't
>>contain your $HTTP_SERVER_VARS["HTTP_HOST"], store
>>$HTTP_SERVER_VARS["PHP_SELF"] in a session variable.
>>
>>At 21:19 6.12. 2000, Wee Chua wrote the following:
>>--------------------------------------------------------------
>>>Hi all,
>>>How could I store the $HTTP_REFERER of the 1st page constantly in my
>>>funtion, so i could always return the 1st page by using the $HTTP_REFERER
>>>value no matter what page i am in. Thanks for any helps.
>>>
>>>Calvin Chua
>>>Systems Analyst
>>>InterClean Equipment, Inc.
>>>734-975-2967
>>>
>>>
>>>--
>>>PHP General Mailing List (http://www.php.net/)
>>>To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
>>>For additional commands, e-mail: php-general-help@lists.php.net
>>>To contact the list administrators, e-mail: php-list-admin@lists.php.net
>>------end of quote------
>>
>>
>>____________________________________________________________
>>Cynic:
>>
>>A member of a group of ancient Greek philosophers who taught
>>that virtue constitutes happiness and that self control is
>>the essential part of virtue.
>>
>>cynic@mail.cz
>>ICQ: 2808 2505
>>
>>
>>
>------end of quote------
>
>
>
>____________________________________________________________
>Cynic:
>
>A member of a group of ancient Greek philosophers who taught
>that virtue constitutes happiness and that self control is
>the essential part of virtue.
>
>cynic@mail.cz
>ICQ: 2808 2505
------end of quote------
____________________________________________________________
Cynic:
A member of a group of ancient Greek philosophers who taught
that virtue constitutes happiness and that self control is
the essential part of virtue.
cynic@mail.cz
ICQ: 2808 2505