Reply LinkBack Thread Tools Search this Thread
Old 27-05-2006, 11:03   #1 (permalink)
eStew!
Registered User
 
Join Date: May 2006
Posts: 1
Creating A Dynamic User Directory

I'm very much an amateur designer with knowledge in XHTML and CSS, with some PHP abilities. I'm wanting to make a site for my friends and eventually others in the future where people can get a page to themselves and in this certain stuff can happen.

Although it's a unrelated, the best design I can think of is that of last.fm where when you click on a user you get a link like: last.fm/user/username and every time a new person signs up a new folder is created.

Is there a specific name for this sort of design that I can look up on Google to find out more about how it is done? Or can anyone suggest a method of doing this?

My initial thoughts were that I could just use PHP to create a new folder in the relevant directory with that user's name but I'm at a loss as to how I would refer to my includes and templates which would then be two or more directories above that default directory for that user.

i.e.

getting from mysite/user/username where index.php there wants to include multiple files from mysite/templates/
  Reply With Quote
Old 27-05-2006, 12:36   #2 (permalink)
MikeMackay
Everything is fine.
 
MikeMackay's Avatar
 
Join Date: Feb 2005
Location: Witham & London
Posts: 764
Send a message via MSN to MikeMackay Send a message via Skype™ to MikeMackay
Personally, I wouldn't create a new subdirectory for each user unless you *really really* want to. You could end up with too many folders and it would become a real nightmare to manage and maintain.

Instead, you could use mod_rewrite to accomplish the same effect but using 1 simple template file.

As a quick example: a user would visit mysite/users/username and they would see a page for that user, however, behind the scenes the server has really dished up the php file mysite/templates/userTemplate.php?username=someuser. The visitor will not see the master template php url in their browser, only the original one (/users/username).

Google for mod_rewrite or even search on this forum - there have been quite a few posts on it over the course of the last 6-12 months. Using PHP you can easily include other template files in the master user template, again do another search on this forum and you should get enough results & info.

Hope this points you in the right direction.

- Mike
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8