Because I was having a "duh" moment.
$_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]
Because I was having a "duh" moment.
$_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]
1 | Christian
You should be using $_SERVER (for PHP4 and up). Other than that, I know exactly what you mean 😉
3 | Louis
November 24th, 2007 at 1:30 pm
Yea thats one of the things that changed from PHP3 to PHP4. I had forgotten all about it. I just used this in my video app that was assigning an incorrect URL to videos. This variable made the correction. Thanks.
4 | Barry
This is fun, and very useful:
if ($_SERVER['HTTP_REFERER']=$_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"])
{echo 'Form came from me';}
else
{echo 'Form came from spam bot at'.$_SERVER['REMOTE_ADDR'].'.';}
What is the use of the ff codes?
if ($_SERVER['HTTP_REFERER']=$_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"])
{echo 'Form came from me';}
else
{echo 'Form came from spam bot at'.$_SERVER['REMOTE_ADDR'].'.';}
6 | Streche
February 27th, 2009 at 1:26 am
Yea, $.SERVER has a lot of other useful elements too.
http://us3.php.net/manual/en/reserved.variables.server.php
These in particular for getting the complete current URL:
SERVER_PROTOCOL
HTTPS
SERVER_PORT