How to automatically assign sudomain to users during registration
<p>I'm currently creating a custom application which involves letting each users have  its own subdomain but I'm finding it hard to make that work. </p>

<p>I want user to do this on the fly during registration. </p>

<p>How do I make this work using PHP, <code>.htaccess</code> and MySQL? </p>

<p>This is what I've done so far. </p>

<pre><code>&lt;?php
$host = $_SERVER ['HTTP_HOST'] ; 

$subdomain = "myshop" ; 

$domain = "$subdomain.$host" ; 

echo $domain ;

?&gt;
</code></pre>