how do you make it so when a u ser registers, they are giving a subdomain
http://username.domain.com
and how would you make it so if someone goes to that subdomain, it would grab the username frmo the url, like usually I would use a $_GET command to grab
?name=username
$_GET['name']
any ideas, thanks!
subdomain user question
Moderator: General Moderators
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: subdomain user question
To get the username from the URL:ecaandrew wrote:how do you make it so when a <span style='color:blue' title='ignorance is bliss'>you</span> ser registers, they are giving a subdomain
http://username.domain.com
and how would you make it so if someone goes to that subdomain, it would grab the username frmo the url, like usually I would use a $_GET command to grab
?name=username
$_GET['name']
any ideas, thanks!
Code: Select all
$url = $_SERVER['SERVER_NAME'];
$url_bits = explode('.', $url);
$username = $url_bits[0];Google "Add subdomains dynamically"
thankyou very much, i did a search and came up with this
http://www.liquidpulse.net/articles/php ... subdomains
looks useful, if anyone has any tips or so, let me know, thankyou!
http://www.liquidpulse.net/articles/php ... subdomains
looks useful, if anyone has any tips or so, let me know, thankyou!