Dynamic user content pages
Moderator: General Moderators
Dynamic user content pages
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
- Jonah Bron
- DevNet Master
- Posts: 2764
- Joined: Thu Mar 15, 2007 6:28 pm
- Location: Redding, California
Re: Dynamic user content pages
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
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
do a google search for "Pretty URL's"
there's a ton of information and tutorials.
there's a ton of information and tutorials.