well, you could prob use php to create subdomains. im not exactly sure how, but you will prob need to use php to write/modify some file that apache will use to see if the subdomains exists, and if so, where to map the subdomains document root to.
i would search the apache manuals for subdomains to find out more on that. it may be possible all you need to do is have an .htaccess file to add the subdomain info to, which could easily be modified/written with php.
you can make directories in php by using
mkdir()
you can write an index.php file or whatever file you want by using
fopen()
fwrite()
fclose()
theres also
copy()
if you wanted to make any request execute a specific php script, you could easily do that with apaches mod_rewite. theres tons of info on mod_rewrite on the web, and in apaches manual. using mod_rewrite, you could eliminate having to make a directory and php file for every user who signs up.
i think mod_rewrite is prob what you would want to use, and it can be confusing to begginners, so ill give you some code that should start you in the right direction.
ps- it may be possible to use mod_rewite for subdomains too, but ive never looked into it.
this would be your .htaccess file in your doc root
RewriteEngine On
# make sure that what they requested is not an actual existing directory
RewriteCond %{REQUEST_URI} !-d
# make sure that what they requested is not an actual existing file
RewriteCond %{REQUEST_URI} !-f
# if the url they requested consists entirely of characters that are NOT forward slash,
# but may optionally end in a forward slash, rewite this request to script.php
RewriteRule ^[^/]+/?$ script.php
then in script.php, use the variable
$_SERVER['REQUEST_URI'] to see what url they entered. just parse the info you want out of it, and then use that info to do whatever you gotta do.
heres some examples of how the rewrite code would behave
http://example.org/poordoggie <-- will get rewritten to script.php
http://example.org/poordoggie/ <-- will get rewritten to script.php, trailing slash is optional
http://example.org/index.php <-- if index.php is a real file on your server, it will NOT be rewritten. if the file doesnt exist, it WILL be rewritten
http://example.org/images <-- if images is a real directory on your server, it will NOT be rewritten. if the directory doesnt exist, it WILL be rewritten
http://example.org/somedir/foo.html <-- will NOT be rewritten. contains forward slash and the slash isnt the last character.
http://example.org/somedir/poordoggie <-- will NOT be rewritten. contains forward slash and the slash isnt the last character.
http://example.org/somedir/poordoggie/ <-- will NOT be rewritten. contains forward slash and the slash isnt the last character.