$HTTP_HOST issue ?
Posted: Sat Jul 08, 2006 10:27 am
I am new to php programming and I am seeing an issue I think?
First Test:
code:
$site[homeurl] = ("http://".$HTTP_HOST."".dirname($SCRIPT_NAME));
Result:
http:// http://www.xyz.com/script
* notice the extra leading http:// in the return value.
Second Test:
$site[homeurl] = ($HTTP_HOST."".dirname($SCRIPT_NAME));
Result:
test.xyz.com/script
I am curious as to why in the first test it adds another "http://"
[/b]http://[/b] http://www.xyz.com/script
I have read the documentation and this should not add the extra "http://" but I do not understand why?
php version:
PHP 5.0.4 (cli) (built: Jun 28 2005 22:35:56)
Apache Version:
2.0.55
OS Version:
Solaris 10/05
Note: "I have changed the real domain to xyz.com".
Thank you in advance for any assistance.
Bob
First Test:
code:
$site[homeurl] = ("http://".$HTTP_HOST."".dirname($SCRIPT_NAME));
Result:
http:// http://www.xyz.com/script
* notice the extra leading http:// in the return value.
Second Test:
$site[homeurl] = ($HTTP_HOST."".dirname($SCRIPT_NAME));
Result:
test.xyz.com/script
I am curious as to why in the first test it adds another "http://"
[/b]http://[/b] http://www.xyz.com/script
I have read the documentation and this should not add the extra "http://" but I do not understand why?
php version:
PHP 5.0.4 (cli) (built: Jun 28 2005 22:35:56)
Apache Version:
2.0.55
OS Version:
Solaris 10/05
Note: "I have changed the real domain to xyz.com".
Thank you in advance for any assistance.
Bob