# Solved: $_server['http_referer']



## Sequal7 (Apr 15, 2001)

Hello guys;

Not sure why, but I just made a very simple send to friend script (in response of another post on here) and for some reason when I set the REFERER 

```
//define server relation of page
[email protected]$HTTP_REFERER;

//send headers to client
$header_message = "Hi $f_name \n Your friend $y_name requested you to visit the page at \n $ref \n";
```
 it would not send a link of the page, just a blank area in the email.
It then used

```
$ref=$_SERVER['HTTP_REFERER']
```
 and it sent the referring link fine.

Any ideas why this would need the server part before the HTTP_REFERER?
Could this be something with my server set up?
I have register_globals off so I am stumped as to why I needed the first part to send the link.

Any ideas, thanks in advance.


----------



## haswalt (Nov 22, 2004)

I believe register globals off will mean you need to use teh abolute hash array, ie the $_SERVER part. if register globals was on you would be able to access the referer inm you previous method.

I thinks that's right.

Harry


----------



## Sequal7 (Apr 15, 2001)

Thanks Harry, I will investigate this further...

Cheers


----------



## MMJ (Oct 15, 2006)

haswalt said:


> I believe register globals off will mean you need to use teh abolute hash array, ie the $_SERVER part. if register globals was on you would be able to access the referer inm you previous method.
> 
> I thinks that's right.
> 
> Harry


That is correct.

register globals makes it so that the suber globals ($_GET, $_POST, $_REQUEST, $_SESSION, $_COOKIE, $_SERVER, $_ENV) keys are set as variables.

http://www.php.net/manual/en/ini.core.php#ini.register-globals


----------



## Sequal7 (Apr 15, 2001)

Thanks for the information


----------

