Need to pick your brain

How would I go about developing a system (in PHP) that would use one website GUI (in my case, Flash) that depending on the username (url example: http://www.somewebsite/username) would be able to pull its distict variables that would affect the FUI according to the usernames preferences (how those variables would be stored isn’t important)… the point is to be able to basically replicate the website when requested at the example url above.

Multi-level marketing websites do this… they all use the same site, but a distributor can sign up and get his own url (ie /john) that is obviously displaying his personal information…

As I said, how those variables are stored isn’t important, I just wanted to pick some brains to find out how it’s possible for a subdirectory to be able to contain the very same website that’s located at the public root… and yes I know there are systems out there to by, but I want to play around with developing my own replicating system.

Thanks so much in advance!

I’m revisiting this. Can anyone help me out?

I’m only familiar with LAMP setups, but in PHP/Apache, there’s the $PATH_INFO environment variables.

Instead of:
[noparse]http://www.yourdomain.com/script.php?var1=val1&var2=val2[/noparse]

you can structure your URL like so:
[noparse]http://www.yourdomain.com/script.php/value1/value2[/noparse]

Then, the $PATH_INFO variable would contain “/value1/value2”. You can simply use


$vals = explode('/', $PATH_INFO);

$var1=$vals[0];
$var2=$vals[1];

Then, you can use those variables to run database queries to get profile settings, pass them to flash via flashVars or whatever else you need to do.