Changing server variables

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Changing server variables

Post by pickle »

Hi all.

This is absolutely mystifying me - I was hoping someone here would know.

I need to get at the variable $_SERVER[HTTP_REFERER]. However, for some reason it is not available. When I echo the server variables on one page, HTTP_REFERER is in the $_SERVER array. However, when I echo the server variables from another page on the same server, HTTP_REFERER is not found. Does anyone know why this may be happening? Thanks.
teniosoft
Forum Newbie
Posts: 15
Joined: Tue Feb 03, 2004 1:01 am
Location: Portland, Or

Post by teniosoft »

can you show us the code for the two different pages of code.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

HTTP_REFERER is set by the client (browser) so that can impact whether or not it is available.

Mac
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

1) The code for both pages is

Code: Select all

<?php

print_r($_SERVER);

?>
I've been very careful to ensure both pages have the same code.

2) I am viewing both of these pages using the same copy of IE6 on my computer. Is there some hidden condition that I'm not aware of?

Thanks.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply