GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   PHP code to detect current domain name? (https://gfy.com/showthread.php?t=597578)

QualityMpegs 04-13-2006 08:06 AM

PHP code to detect current domain name?
 
lets say i execute a script like: http://www.domain.com/script.php
what would be the php code to detect the "domain.com" and make it a variable?

StuartD 04-13-2006 08:08 AM

$_server[http_host]

all caps... (gfy won't let me because it has an "anti-shouting" script)

psili 04-13-2006 08:08 AM

$_server["http_host"];

?

edit -- all caps

QualityMpegs 04-13-2006 08:10 AM

thanks guys!

Jer 04-13-2006 08:12 AM

They said it already and I wanted to post something

QualityMpegs 04-13-2006 08:15 AM

Code:

$domain=$_SERVER["HTTP_HOST"];
$domain=str_replace("www.","", $domain);
echo $domain;


DaddyHalbucks 04-13-2006 08:18 AM

GFYers are smart, huh?

QualityMpegs 04-13-2006 08:21 AM

Quote:

Originally Posted by DaddyHalbucks
GFYers are smart, huh?

better than a damn php forum


All times are GMT -7. The time now is 02:39 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123