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.