tibberous Posted September 30, 2007 Share Posted September 30, 2007 I am trying to make a site that can take in a string as the sub domain for the site. For example, if you put in, Jenny.homepage.com, the site would get Jenny as a parameter. Does anyone know how to do this? Thanks Link to comment https://forums.phpfreaks.com/topic/71224-dynamic-subdomains/ Share on other sites More sharing options...
fanfavorite Posted September 30, 2007 Share Posted September 30, 2007 Well getenv(HTTP_HOST); will give you jenny.homepage.com. So from there I would do this: $domain = getenv(HTTP_HOST); $dnexplode = (".",$domain); $cname = $dnexplode[0]; Link to comment https://forums.phpfreaks.com/topic/71224-dynamic-subdomains/#findComment-358270 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.