如何把一个ASP程序嵌入到一个静态html里
ASP程序:<html><title>计数</title><color="red"><body><%DimNumVisitsNumVisits=0Application....
ASP程序:
<html>
<title>计数</title>
<color="red">
<body>
<%
Dim NumVisits
NumVisits=0
Application.Lock
Application("NumVisits") = Application("NumVisits") +1
Application.Unlock
%>
<color=red>
欢迎光临本网页,你是本页的第<%=Application("NumVisits")%>位访客!
</body>
</html>
把它放入:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>我的网站</title>
里
要能成功使用
</head>
<body>
<table width="100%" border="1" bordercolor="#000000" bgcolor="#FFFF00">
<tr>
<td width="82" align="center">首页</td>
<td width="118" align="center">频道一</td>
<td width="118" align="center">频道二</td>
<td width="118" align="center">频道三</td>
<td width="118" align="center"><a href="chat.asp">聊天室</a></td>
<td width="118" align="center">备用一</td>
<td width="227" align="center"><a href="index2.html">帮助</a></td>
</tr>
</table>
</body>
</html> 展开
<html>
<title>计数</title>
<color="red">
<body>
<%
Dim NumVisits
NumVisits=0
Application.Lock
Application("NumVisits") = Application("NumVisits") +1
Application.Unlock
%>
<color=red>
欢迎光临本网页,你是本页的第<%=Application("NumVisits")%>位访客!
</body>
</html>
把它放入:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>我的网站</title>
里
要能成功使用
</head>
<body>
<table width="100%" border="1" bordercolor="#000000" bgcolor="#FFFF00">
<tr>
<td width="82" align="center">首页</td>
<td width="118" align="center">频道一</td>
<td width="118" align="center">频道二</td>
<td width="118" align="center">频道三</td>
<td width="118" align="center"><a href="chat.asp">聊天室</a></td>
<td width="118" align="center">备用一</td>
<td width="227" align="center"><a href="index2.html">帮助</a></td>
</tr>
</table>
</body>
</html> 展开
3个回答
展开全部
asp代码//不要添加html标签
<%
Dim NumVisits
NumVisits=0
Application.Lock
Application("NumVisits") = Application("NumVisits") +1
Application.Unlock
%>
<%="document.write('欢迎光临本网页,你是本页的第"&Application("NumVisits")&"位访客!')"%>
html代码//放到html文件中
<script type="text/javascript" src="index.asp"></script>
<%
Dim NumVisits
NumVisits=0
Application.Lock
Application("NumVisits") = Application("NumVisits") +1
Application.Unlock
%>
<%="document.write('欢迎光临本网页,你是本页的第"&Application("NumVisits")&"位访客!')"%>
html代码//放到html文件中
<script type="text/javascript" src="index.asp"></script>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询