<%@ Language=VBScript %>
<%
Response.Buffer=true ' 设置输出缓存,用于显示不同页面。
On error resume next ' 忽略程序出错部分
If Request.ServerVariables("Request_Method")="GET" then
' 判断客户是以什么方式请求 WEB 页面
'------------------------
' 客户登陆界面
'------------------------
%>
<%
Response.End ' 结束程序的处理
Else
Response.clear ' 清空缓存中的内容
dim talk
If Request.Form("nick")<>"" then
' 判断客户是是否在聊天界面中
Session("nick")=Request.Form("nick")
End If
'------------------------'
'客户聊天界面
'------------------------
%>
<%
If Request.Form("log")<>1 then
If trim(Request.Form("talk"))="" then
' 判断用户是否没有输入任何内容
talk=Session("nick")&" 沉默是金。"
Else
talk=trim(Request.Form("talk"))
' 去掉字符后的空格
End If
只有一个页面chat.asp,我通过判断请求类型
If Request.ServerVariables("Request_Method")="GET" then
' 判断客户是以什么方式请求 WEB 页面
'------------------------
' 客户登陆界面
'------------------------
%>
。。。。。
<%
Response.End ' 结束程序的处理
Else
Response.clear ' 清空缓存中的内容
dim talk
If Request.Form("nick")<>"" then
' 判断客户是是否在聊天界面中
Session("nick")=Request.Form("nick")
End If
'------------------------'
'客户聊天界面
'------------------------
%>
.....