Dynamic user content pages

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Bcapecci
Forum Newbie
Posts: 2
Joined: Sat Oct 16, 2010 6:32 pm

Dynamic user content pages

Post 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
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: Dynamic user content pages

Post 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
Bind
Forum Contributor
Posts: 102
Joined: Wed Feb 03, 2010 1:22 am

Re: Dynamic user content pages

Post by Bind »

do a google search for "Pretty URL's"

there's a ton of information and tutorials.
Post Reply