views:

82

answers:

3

What i want to do is to create an web page for every user when they signup on my page. Example: www.someweb.com/username and this will be their webpage.

I know that this can be done easy with mkdir() and other related functions, but the problem is that my root folder is not chmod 777 and i don want to chmod 777 this root folder because of security reason.

What is the best way to do this thing when user registers on my web page

+2  A: 

Most likely you don't need to create these directories in real.
Just make it virtual.
Pass a username using query string, like this:

www.someweb.com/index.php?user=username

And personalize this page according to particular username. After that you can do some rewrite magic and make a page address like this www.someweb.com/username but all pages will remain virtual

Col. Shrapnel
The problem is that i want this to be as i pointed up there, is more professional and much clean
AXheladini
Dear @AXheladini before making it look professional, you have to make it just work. An only then do some decorations, bells and whistles.
Col. Shrapnel
+5  A: 

Use mod_rewrite to make a request to /username actually be ?user=username. You can then get the appropriate user's data and display it in a template.

Jacob Relkin
how to configure the RewriteRule for this yrl: someweb.com/users.php?username=agonfx21
AXheladini
+5  A: 

You don't make physical directories for each user, you use URL rewriting. Take a look at

http://www.yourhtmlsource.com/sitemanagement/urlrewriting.html

Tatu Ulmanen