How to realize the Web browsing record display? _php Tutorials

Source: Internet
Author: User
Tags tagname
How to realize the Web browsing record display?
Answer
For example, Thunder look at the edge of the historical view, there are some news sites in the history of click, there is no such case? Please advise, thank you.


Other Solutions
Save the URL and page title to a cookie or session
Other Solutions
Use a pen and a book to write down ....
Other Solutions
Found on the Internet with JS and cookie implementation, but not very clear function glog (evt)//Definition of mouse click action Functions

{

Evt=evt?evt:window.event;var srcelem= (evt.target) evt.target:evt.srcElement;

Try

{

while (Srcelem.parentnode&&srcelem!=srcelem.parentnode)

The above statement determines whether the mouse action occurs in the active area, preventing the user's invalid click is also recorded

{

if (srcelem.tagname&&srcelem.tagname.touppercase () = = "A")//Determines whether the object clicked by the user belongs to the link

{

linkname=srcelem.innerhtml; Take out the name of the source in which the event occurred, that is, the text between and, that is, the link name ha

address=srcelem.href+ "_www.achome.cn_"; Take out the href value of the source of the event, that is, the address of the link

Wlink=linkname+ "+" +address; Combine link names and link addresses into one variable

Old_info=getcookie ("History_info"); Remove the browsing history of the previous record from the cookie, which is declared after the function

The following procedure starts to determine if the new browse action is duplicated with the previous 6 history, and if it is not duplicated, the cookie is written

var insert=true;

if (old_info==null)//Determine if the cookie is empty

{

Insert=true;

}

Else

{

var old_link=old_info.split ("_www.achome.cn_");

for (Var j=0;j<=5;j++)

{

if (Old_link[j].indexof (linkname)!=-1)

Insert=false;

if (old_link[j]== "null")

Break

}

}



if (insert)

{

Wlink+=getcookie ("History_info");

Setcookie ("History_info", wlink); Write a cookie, which is declared after the function

History_show (). reload ();

Break

}



}

Srcelem = Srcelem.parentnode;

}

}

catch (e) {}

return true;

}

function Getcookieval (offset) {

var endstr = document.cookie.indexOf (";", offset);

if (endstr = =-1) endstr = document.cookie.length;

Return unescape (document.cookie.substring (offset, endstr));

}



function GetCookie (name) {

var arg = name + "=";

var alen = Arg.length;

var clen = document.cookie.length;

var i = 0;

while (I < Clen) {

var j = i + Alen;

if (Document.cookie.substring (i, j) = = arg) return Getcookieval (j);

i = Document.cookie.indexOf ("", I) + 1;

if (i = = 0) break;

}

return null;

}



Write a browse action to a cookie

function Setcookie (name, value) {

var exp = new Date ();

Exp.settime (Exp.gettime () +3600000000);

Document.cookie = name + "=" + Value + "; Expires= "+ exp.togmtstring ();

}

function History_show ()

{

var History_info=getcookie ("History_info"); Remove the history from the cookie

var content= ""; Define a display variable

if (history_info!=null)

{

History_arg=history_info.split ("_www.achome.cn_");

var i;

for (i=0;i<=5;i++)

{

if (history_arg[i]!= "null")

{

var wlink=history_arg[i].split ("+");

content+= ("↑" + "+wlink[0]+"
");

}

document.getElementById ("History"). Innerhtml=content;

}

}

Else

{document.getElementById ("history"). Innerhtml= "Sorry, you do not have any browsing record";}

}[/I][/I]


Copy Code
Other Solutions
It's useful for me to make a mark.
Other Solutions
Use a pen and a book to write down ....
Anjo published in 2008-6-3 11:13 [url=http://bbs.phpchina.com/redirect.php?goto=findpost&pid=459164&ptid=64656] link marker [ Img]http://bbs.phpchina.com/images/common/back.gif[/img][/url]
A good way to do it!
Other Solutions
Damn it, now I know it's dug out of the ancient corpse ...

http://www.bkjia.com/PHPjc/632381.html www.bkjia.com true http://www.bkjia.com/PHPjc/632381.html techarticle How to realize the Web browsing record display? The answer, such as thunder look at the edge of the historical view, there are some news sites in the history of click, there is no such case? Please advise, ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.