Customizing webpages for logged in users with php

rmrf

Platinum Member
May 14, 2003
2,872
0
0
Ok, I've hacked together a few scripts which register a user, and allow the user to log in, but I'm not sure where to go from here. I am trying to model my site after a browser-based mmorpg that I frequent. This is what I don't understand.

When I visit the site, I type the address in, and it takes me to the front page. www.example.com

On this page, it knows I am not logged in, so on the left hand side, it allows me to type in my login information. Once I have logged in, it redirects me to my "home" page, www.example.com/home.php

This is where I get hung up. If I manually type that into the address bar, it redirects me to the login page. When another user logs on, I can only assume that they get the same page as I do, but it displays their information instead of mine, how is this done? Are there just a bunch of tables in a DB that it grabs user specific information from, and uses php to display this information? And where does the user specific information come from, cookies?

Obviously I am a n00b at this, and if this is something that a beginner book will teach me how to do, please let me know what book it is. If anyone can help, I would greatly appreciate it.

Sorry for the book, but I tried to include all the information that I am confused about, so whoever can help me has all the information they need. If you need more information, please let me know through this thread or via PM. Thanks to anyone who can help.
 

Modeps

Lifer
Oct 24, 2000
17,254
44
91
I'm a bit confused as to what you are doing... I'm guesing you've taken other peoples' scripts and used them for your user registration and login? That's fine and dandy, but honestly you probably should have written your own if you're a noob. Writing your own will help you learn more and more about how php works and how it interfaces with mysql.

Things dont automatically just happen with dynamic websites, so you cant really assume anything. The script that you used, may be using either session variables or cookies to store user information

Be sure to check out http://www.php.net , it's a great resource.