www.gusucode.com > 超文本多用户论坛程序 1.1 > bbs/writedx.asp

    <!--#include file="conn.asp"-->
<!--#include file="gyhs.asp"-->
<head>
<title><%=request.cookies("mc")%></title>
<meta name="keywords" content="<%=request.cookies("gjz")%>">
</head>
<body topmargin=0>
<%
'判断登陆
if dlhs=true then
%>
<script  language=vbscript>
<!--
window.alert"对不起!你还没有登陆"
window.location="index.asp?ltbh=<%=ltbh%>"
-->
</script>
<%end if%>
<%
ltuser=request("ltuser")
%>
<form action="writedx.asp?ltbh=<%=ltbh%>" method=post>
<input type=hidden name=menu value=fa>
<table cellpadding="0" cellspacing="0" width="320" height="170" align=center>
	<tr>
		<td width="338" height="30" align="left">昵称:<input type="text" name="sxuser" size="20" value="<%=ltuser%>"></td>
	</tr>
	<tr>
		<td width="338" height="55" align="left">
		<textarea rows="6" name="dxcount" cols="39"></textarea> </td>
	</tr>
	<tr>
		<td width="338" height="26" align="center">
		<input onclick="window.close()" type="reset" value="取消发送">&nbsp;
		<input type="submit" value="发送信息"></td>
	</tr>
	<tr>
		<td width="338" height="55" align="left">

		<iframe name="content" cols="39" rows="6" src="jl.asp?ltuser=<%=ltuser%>&ltbh=<%=ltbh%>" width="306" height="94" align="left">
		浏览器不支持嵌入式框架,或被配置为不显示嵌入式框架。</iframe>

		</td>
	</tr>
</table>
</form>
<SCRIPT RUNAT=SERVER LANGUAGE=VBSCRIPT>					
function CleanHtmlBr(str)									
	CleanHtmlBr =  Replace(Replace(Replace(Replace(Replace(str,"<","&lt;"),">","&gt;"),vbCrlf, "<br>"), chr(32)&chr(32),"&nbsp;&nbsp;"),"'","''")		
End Function		
</SCRIPT>
<%
if request("menu")="fa" then
wbfz
sxuser=CleanHtmlBr(request("sxuser"))
fxuser=request.cookies("username")
dxcount=CleanHtmlBr(request("dxcount"))

sxr="select id from zwuser where cnuser='"&sxuser&"'"
set rs1=conn.execute(sxr)
if rs1.eof then
	response.write "<script language='javascript'>alert ('*该用户不存在不能发信息!');history.go(-1);</script>" 
	response.end
rs1.close
set rs1=nothing		
end if

if sxuser=fxuser then
	response.write "<script language='javascript'>alert ('*不能给自己发送短信!');history.go(-1);</script>" 
	response.end
end if

if sxuser=empty or dxcount=empty then
	response.write "<script language='javascript'>alert ('*发信人昵称和短信内容不能为空!');history.go(-1);</script>" 
	response.end
end if

if len(dxcount)>255 then
	response.write "<script language='javascript'>alert ('*短信内容不能超过255个字符!');history.go(-1);</script>" 
	response.end
end if

sql="insert into zwdx(sxuser,fxuser,dxcount)values('"&sxuser&"','"&fxuser&"','"&dxcount&"')"
conn.execute(sql)
response.redirect "writedx.asp?ltbh="&ltbh&"&ltuser="&sxuser&""
end if
%>
<%
dbclose
%>