Thread: PHP help please
View Single Post
Old 10-18-2002, 02:17 PM  
3Xguru
Confirmed User
 
Join Date: Sep 2001
Location: Iasi
Posts: 1,281
Quote:
Originally posted by Rory
So here is everything you need :
PHP Code:
$current_host $_SERVER['HTTP_HOST'];
$current_path $_SERVER['PHP_SELF'];

$full_web_path "http://" $current_host $current_path
Now the variable $full_web_path contains the correct info. The "http://" is optional. Like I said above if your PHP < 4.1 you will need to use $HTTP_SERVER_VARS instead of $_SERVER. So this would replace if you are running an earlier version of PHP :
PHP Code:
$current_host $HTTP_SERVER_VARS['HTTP_HOST'];
$current_path $HTTP_SERVER_VARS['PHP_SELF'];

$full_web_path "http://" $current_host $current_path
Hope that helps.

Rory
Thanks again. We need more helping people like you on this board.
__________________
-=Free Webmaster Tools=-
3Xguru is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote