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 Quote 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]; Quote Link to comment https://forums.phpfreaks.com/topic/71224-dynamic-subdomains/#findComment-358270 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.