A simple website page Click record ver0.1

Source: Internet
Author: User
Save this page as any name. ASP. Visit is assumed here. ASP; add 0 then err to the page for statistics clicks and views. clear set objadxcat = Createobject ("ADOX. catalog ") objadxcat. create con_strset objcon = objadxcat. activeconnectionset objadxcat = nothing objcon.exe cute "create table tblvisit (strname text (" & sciript_name_max_length & ") primary key, lngcount integer)" If err. number0 then on error goto 0 set objcon = nothing err. raise vbobjecterror, "add ()", "can't open or create dB, maybe dB file error. "end if on error goto 0 'Find script_path in dB and add visit count, if the script_path doesn' t exist, then create a new record. objcon. execute "Update tblvisit set lngcount = lngcount + 1 where strname = '" & strsafename & "'", lngaffected, ad1_textif lngaffected = 0 then objcon. execute "insert into tblvisit (strname, lngcount) values ('" & strsafename & "', 1)" If objcon. stateadstateclosed then objcon. closeset objcon = nothing add = "OK" end function main: Sub main () dim strrefurlstrrefurl = trim (request. servervariables ("http_referer") If strrefurl "" And strrefurlsession ("lastvisitedpage") then call add (strrefurl) session ("lastvisitedpage") = strrefurlend if end sub %>

Csdn's online editor is really bad !!!!!!

Save this page as any name. asp. Here we assume visit. asp; add <SCRIPT src = "visit. asp"> </SCRIPT> to the page where statistics are clicked and viewed.

 

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.