ASAAKI
03-28-2003, 01:18 PM
so far in php i've only worked with database interaction and ordinary programming, so i don't know much about sessions, cookies, http_...stuff etc.
i'm doing a site where registered users get to choose their custom css style for the site, work on language lessons, take tests and exercises, etc. whenever they log in they can go to their own user page and everything here should be customized according to themselves; the site style (colors, etd), a link to the lesson they're currently studying, a link to their past performance, a link to a list of threads they're subscribed to in the site's forum (pretty much like here at CF), a link to .... you get the idea.
for one thing, i'm not exactly sure what would be right to use, cookies or sessions, or both:confused:. by reading previous threads i guess i'll be using sessions.
but the main problem is how can i go about tracking the user's activity so that i know which page he/she left off on last time, so that when he/she logs in again, there should be a link to that particular page? what i can think of so far is that every page should have a session_start on top and should register the user on it, then when the user closes the browser, the session stores the page he was on that was closed, to get inserted in the database.
like for eg, if A signs in and goes to page1, the session "username" will be registered with value "A" and variable "curr_page" will also be registered and will update the A's 'curr_page' column in the database. then, when he goes to page2, "curr_page" will change and update the database again. and so on until the user simply disconnects or closes the browser window.
that's what i can think of so far, no idea if it's the right approach. any suggestions?
i'm doing a site where registered users get to choose their custom css style for the site, work on language lessons, take tests and exercises, etc. whenever they log in they can go to their own user page and everything here should be customized according to themselves; the site style (colors, etd), a link to the lesson they're currently studying, a link to their past performance, a link to a list of threads they're subscribed to in the site's forum (pretty much like here at CF), a link to .... you get the idea.
for one thing, i'm not exactly sure what would be right to use, cookies or sessions, or both:confused:. by reading previous threads i guess i'll be using sessions.
but the main problem is how can i go about tracking the user's activity so that i know which page he/she left off on last time, so that when he/she logs in again, there should be a link to that particular page? what i can think of so far is that every page should have a session_start on top and should register the user on it, then when the user closes the browser, the session stores the page he was on that was closed, to get inserted in the database.
like for eg, if A signs in and goes to page1, the session "username" will be registered with value "A" and variable "curr_page" will also be registered and will update the A's 'curr_page' column in the database. then, when he goes to page2, "curr_page" will change and update the database again. and so on until the user simply disconnects or closes the browser window.
that's what i can think of so far, no idea if it's the right approach. any suggestions?