-
Newbie
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
-
-
Sorcerer Supreme
-
Newbie
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.
-
Grand Master
Noone wants their internet history to be tracked.
Cookies are only readable by the site that set them, for security reasons.
-
Newbie
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.
-
Grand Master
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.
-
Newbie
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.
-
Grand Master
Maybe you should just try and explain yourself better? :o
-
Newbie
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.
-
Grand Master
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.