Problem (Please help )

Results 1 to 5 of 5

Thread: Problem (Please help )

  1. #1
    Join Date
    Dec 1969

    Default Problem (Please help )

    Hi All,<BR><BR>I am developing a internet site and in that client wants the bookmark utility means if the user exits in between the course and wants to come back next day then when he logs on again the user should redirect to that page only.For that i am using login screen where user enter the name and password and using access as a backend my problem is how to store the value of the last visit page and then redirect the user to that page when logs on again for your information there is a bookmark buttton on every page.If somebody know about this then please help me out.<BR><BR>Thanks & Regards<BR>James Thomson

  2. #2
    MG Guest

    Default RE: Problem (Please help )

    There might be other ways but here is one:<BR>One each and every page that is accessed: Write an insert statement to the table with the user information and insert the page that they are visiting. Then if they leave from that page, when they login again you can check that "lastvisitedpage" field and send them there.

  3. #3
    Join Date
    Dec 1969

    Default Minor mod to that...and another way

    MG suggested doing an insert for each page visited. If you were doing something like a testing system, that would be perfect: You could record the user&#039s score for that page at the same time. So you&#039d then simply go to the page after the last one where a score was recorded.<BR><BR>But if you only need to keep track of one "last visited" page per user, then it&#039s probably better to do an UPDATE on the user&#039s record, rather than an INSERT.<BR><BR>Something like:<BR><BR>SQL = "UPDATE userTable Set lastVisited=" & thisPage & " WHERE userName=&#039" & thisUser & "&#039"<BR><BR>HOWEVER....<BR><BR>Why use a database? This seems like a perfect use of cookies. Just write/rewrite a cookie to the user&#039s browser as he visits each page. When he logs back in again (automatically! thanks to the other cookie value[s] you stored on his machine), you read the cookie and redirect him to the right page. Bingo. Easy. Done.<BR><BR>Heck, you could even let the user set a number of bookmarks (10? 20? more?) and keep the whole set of bookmarks in a single cookie. Really easy.<BR><BR>

  4. #4
    MG Guest

    Default Sorry, I meant Update


  5. #5
    MG Guest

    Default Please do Not CROSSPOST NEXT TIME

    This is a crosspost from the Moderated Advanced Forum which I am surprised it made it throught the "moderation" anyway since it is not very advanced.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts