tags:

views:

27

answers:

2

I have been using the following to discover the full url, but it does not detect the subdomain I am calling from.

$current_url = "http://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]."";
echo $current_url;EXIT;

Any advice?

+1  A: 

$_SERVER['HTTP_HOST'] should include the subdomain. Can you link us to an example page?

ceejayoz
A: 

Tested and works fine for me. Used this code:

<?
$current_url = "http://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]."";
echo $current_url;EXIT;
?>
Edd Turtle