Jump to content

Recommended Posts

Greetings,

 

I'm in some trouble making a login page that shows some personal information. I'll give u a detailed example.

 

I've got an inlog.php page wich redirects to another page named userarea.php. This user area contains a guestbook, a foto album and some personal information.

 

When someone logs in with for example username = John, password = 123, the page should show different messages in the guestbook, different foto's in the foto album and different personal information displayed on the userarea.php page.

 

So my guesses are that I need at least 4 tables, correct me when I'm wrong;

 

A table users with user_id (primary, AI), username, password.

A table information with for example information id (primary, AI), name, text.

A table guestbook with guestbook_id (primary, AI), name, text, date, time, ipadress (to block when spam)

A table photoalbum with photoalbum_id (primary, AI), title, picture, message, date

 

Than I should probably link the information_id, the guestbook_id and the photoalbum_id to my user_id. But I have no idea how to do this and how to display this on the page.

 

So I know how to make the guestbook and the album, the only problem is showing different messages from the guestbook, different information and different pictures in the album when different users log in.

 

Could someone please tell me how I can do this?

 

Thanks for your time!

 

Yours,

 

Forocon

A user's information (their name, bio, whatever) would typically just be in the same table as their username and password, so you would just have three tables:

 

[*] users (storing the login and personal info)

[*] guestbook (storing all guestbook entries)

[*] photoalbum (storing all photos)

 

In order to link the guestbook and photo's to the proper user, you include a user_id column in those tables which has the same value as the user_id column from the users table.  Then you just select from those tables the entries WHERE user_id=$theLoggedInUser

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.