'==================================
'=过 程 名:countt
'=功 能:访问量统计
'==================================
function countt(str)
str="000000"
Provider = "Provider=Microsoft.Jet.OLEDB.4.0;"
Path = "Data Source=" & Server.MapPath("visite#data.asp")
Set conn= Server.CreateObject("ADODB.Connection")
p1=Provider&Path
conn.Open P1
c_path="/count" '设置安装目录,如/count
dim visiter
dim sql
dim rs
sql="select visiter from visiter"
set rs=conn.execute(sql)
count=rs("visiter")
soonhostcomlen=len(count)
for i=1 to soonhostcomlen
str=str+"mid(count,i,1)"
next
sql="update visiter set visiter=visiter+1"
rs.close
set rs=nothing
conn.execute(sql)
conn.close
set conn=nothing
return str
End function
%>
我要把这个函数用到本文件中的另外一个函数FOOT()函数中,STR就是要返回的变量.
FOOT()函数如下
'==================================
'=过 程 名:foot
'=功 能:页面脚部信息显示
'==================================
sub foot()
dim javastr
javastr="000000"
rem javastr=countt(javastr)
rem call countt(javastr)
rem src="countt(javastr)"></script>
m_foot=replace(m_foot,"$weburl$",weburl)
m_foot=replace(m_foot,"$webname$",webname)
m_foot=replace(m_foot,"$webemail$",webemail)
m_foot=replace(m_foot,"$sitebuild$",sitebuild)
m_foot=replace(m_foot,"]</span>","")
m_foot=replace(m_foot,"$webstyle$",mb_name&"您是第"&javastr&"位访问者" &"]</span>  <a href=""Counter/show.asp"" target=""_blank"">查看访问量统计</a><br>")
m_foot=replace(m_foot,"$webboss$",webboss)
sql="select url,title,target,name from Ft_menu where items=0 and navwz=0 and shown=true"
[知识问答ωωω.χiuGoo.сom]
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if not rs.eof then
do while not rs.eof
footurl=rs(0)
foottitle=rs(1)
foottarget=rs(2)
footname=rs(3)
footmenu=footmenu+"<a href="&footurl&" title="&foottitle&" target="&foottarget&">"&footname&"</a> | "
rs.movenext
loop
footmenu=replace(footmenu,"_self>静音版","_top>静音版")
else
footmenu="欢迎使用学校网站管理系统"
end if
rs.close:set rs=nothing
if right(footmenu,7)="| " then
footmenu=left(footmenu,len(footmenu)-7)
end if
m_foot=replace(m_foot,"{$footmenu}",footmenu)
response.write m_foot
CloseDatabase
end sub