Recently Visited Pages code?????

Results 1 to 10 of 10
  1. #1
    Newbie Merewood is offline
    MemberRank
    Dec 2003 Join Date
    germanyLocation
    23Posts

    Recently Visited Pages code?????

    Hey guys,

    Ive been trying to make a website and im having a little trouble with this one part. im trying to make a column of recently visited sites. i went to amazon.com w/ and w/o cookies enabled and it seems that even they use cookies to track ur recently visited items. Does anybody here know how to code such a cookie? thx, ill keep trying to google it but i cant seem to find anything.

    IE 6.0
    Apache 2.2.4
    HTML/Javascript only :\

    -Merewood


  2. #2
    Sorcerer Supreme admLoki is offline
    Member +Rank
    Apr 2005 Join Date
    www.codenetwork.ruLocation
    345Posts
    Use cookies .

  3. #3
    Newbie Merewood is offline
    MemberRank
    Dec 2003 Join Date
    germanyLocation
    23Posts
    Did you read my post? i am aware that you have to use cookies, but i dont know how to code such a cookie. Any ideas/help? thx.

  4. #4
    Grand Master username1 is offline
    Grand MasterRank
    Jul 2004 Join Date
    5,867Posts
    Noone wants their internet history to be tracked.

    Cookies are only readable by the site that set them, for security reasons.

  5. #5
    Newbie Merewood is offline
    MemberRank
    Dec 2003 Join Date
    germanyLocation
    23Posts
    okay, so how do other websites do it then, ie amazon, ebay, countless others. please post either info or links to how to do it not simply what to use.

  6. #6
    Grand Master username1 is offline
    Grand MasterRank
    Jul 2004 Join Date
    5,867Posts
    You're not making any sense. Those websites are merely tracking if you have visited them (just like this forum -- see the "You last visited" portion of the main page) by setting a cookie every time you visit, then retrieving that cookie again later.

    You appear to be wanting to get a history of the other sites that your users have viewed. That's spyware. And that's bad.

  7. #7
    Newbie Merewood is offline
    MemberRank
    Dec 2003 Join Date
    germanyLocation
    23Posts
    where are you getting this from? i just want to make something like this site's "your last visited" portion. i only want to track progress on my domain, im not trying to make any spyware. i just dont know how to write this cookie.


    EDIT: Maybe this explains better; "last viewed item". i have a collection of pages on my website, i want the user to be able to see what page/ item he was last at so he can easaly go back to that item/page.
    Last edited by Negata; 19-01-07 at 03:05 PM.

  8. #8
    Grand Master Ratboy is offline
    Grand MasterRank
    Sep 2005 Join Date
    Ipswich EngLocation
    989Posts
    Maybe you should just try and explain yourself better? :o

  9. #9
    Newbie Merewood is offline
    MemberRank
    Dec 2003 Join Date
    germanyLocation
    23Posts
    which is exactly what i did in my last post..


    i have a website...i have several 'items' pages (not a shopping cart software). i want users to be able to see which 6 'items'(pages on my domain) they last viewed so that they can easaly go back to them. how do i code this? javascript/html only.


    Example:

    "Recently viewed items
    -item 1- (w/ hyperlink to that page)
    -item 2- (w/ hyperlink)
    -item 3- (w/ hyperlink)
    etc"
    Last edited by Merewood; 19-01-07 at 07:15 PM.

  10. #10
    Grand Master username1 is offline
    Grand MasterRank
    Jul 2004 Join Date
    5,867Posts
    For best results, you need to use PHP.

    Write to a cookie a number that indicates which sections have been visited; this can be done in binary, by assigning the following values to each section:

    1 1
    2 2
    3 4
    4 8
    5 16
    6 32

    Add together each one and you get one integer that can be written to a cookie. Whenever the user requests the URL of one of the sections, the server calculates the new value (it may not change) and sends back the updated cookie.

    The information contained within the cookie can be displayed by masking the bits related to the other sections and testing if the result is zero or not.



Advertisement