We need to dynamically create a subdomain for a main site so when a user sign up as an affiliate a subdomain is created such as this:
[url removed, login to view]
Second part is when a visitor browse to the subdomain: a function that should be called to fetch the userid for the subdomain owner from a database table and save it in a session variable.
So two parts:
1. Create the physical sub domain when an affiliate signs up
2. Function to translate the sub domain site visitor enters to a userid and store the userid in a session variable. Domain should continue to appear as the subdomain but show content from the main domain.