Page 1 of 1

Dynamic user content pages

Posted: Sat Oct 16, 2010 6:53 pm
by Bcapecci
Hey everyone, I'm new to web programming so I thought I would join a active community to help me out. Anyhow, I'm making a game portal and I want the users games to have a url like so... games/username/gamename. From what I understand I could get this structure by simply using data from my login session(username) and using my upload form(gamename) and mkdir. Then I would need to have an index page inside every gamename folder? How would I add the index pages inside such folders. This way seems pretty inefficient to do considering I could pull the games dynamically in a single php file. Is there a way I can make my url look nice and still use one file to handle the embedding of the games, comments etc. Thanks

Re: Dynamic user content pages

Posted: Sat Oct 16, 2010 7:06 pm
by Jonah Bron
Take a look at the mod_rewrite Apache module. It allows you to map addresses like:

http://example.com/games/user/gamename

to

http://example.com/games.php?user=user&gamename=gamename

Here's a URL rewriting tutorial:

http://www.yourhtmlsource.com/sitemanag ... iting.html

Re: Dynamic user content pages

Posted: Sun Oct 17, 2010 3:30 am
by Bind
do a google search for "Pretty URL's"

there's a ton of information and tutorials.