jigdesigns
18 Jul 2012, 03:08 AM
Hi guys,
I'm new to website design, but getting on pretty well, but wanted to ask you experienced developers out there for some help/advice please.
I have a login page, username/password as norm. In this php page, I connect and validate details against mysel database, all normal process, but in the mysql table, I have a forwarding link to a new php page for that username.
Once one this new php page, I want to display that users details, e.g. I have a tabbed div, account info, and other tabs only relating to that user's data.
So I've been reading up on sessions/cookies and wanted to know what I'm doing wrong, can someone show me some code on how I should achieve this please?
Login php
I know i have to start the session here, if login successful then copy username to a session_id, which I get, but what then do I put on my other php page, again start with 'start_session' and can I then use the local variable (username) in my sql to retrieve this persons data from my mysql tables?
Can someone also tell me if I should be using cookies for this exercise? Not really clued up on this section and I've read loads but not really getting it.
Thank you all for ANY help/comments in advance.
I'm new to website design, but getting on pretty well, but wanted to ask you experienced developers out there for some help/advice please.
I have a login page, username/password as norm. In this php page, I connect and validate details against mysel database, all normal process, but in the mysql table, I have a forwarding link to a new php page for that username.
Once one this new php page, I want to display that users details, e.g. I have a tabbed div, account info, and other tabs only relating to that user's data.
So I've been reading up on sessions/cookies and wanted to know what I'm doing wrong, can someone show me some code on how I should achieve this please?
Login php
I know i have to start the session here, if login successful then copy username to a session_id, which I get, but what then do I put on my other php page, again start with 'start_session' and can I then use the local variable (username) in my sql to retrieve this persons data from my mysql tables?
Can someone also tell me if I should be using cookies for this exercise? Not really clued up on this section and I've read loads but not really getting it.
Thank you all for ANY help/comments in advance.