Thread: PHP help please
View Single Post
Old 10-18-2002, 01:53 PM  
Rory
Confirmed User
 
Join Date: Jul 2002
Location: I Love Ixtapa, Mexico ö
Posts: 616
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
Rory is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote