这是两个文件的代码,可是我不会怎么把他们组合在一起啊:
browserdata.asp(显示页面)
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="command.asp" -->
<script language="JavaScript">
function GetResult()
{
var oBao = new ActiveXObject("Microsoft.XMLHTTP");
oBao.open("POST","browserserverold.asp",false);
oBao.send();
var strResult = unescape(oBao.responseText);
var arrResult = strResult.split("###");
RemoveRow();
for(var i=0;i<arrResult.length;i++)
{
arrTmp = arrResult[i].split("@@@");
cont='<div class="u"><strong>'+arrTmp[0]+'</strong> 对 <strong>'+arrTmp[1]+'</strong> 说</div><div class="d">时间:'+arrTmp[2]+'</div><div class="co">'+arrTmp[3]+'</div>';
row1 = tb.insertRow();
cell1 = row1.insertCell();
cell1.innerHTML = cont;
}
}
browserserver.asp(后台处理页面,根据建议修改的,但是最终出来的结果是乱码)
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Connections/conn.asp" -->
<%set rs=Server.CreateObject("ADODB.RecordSet")
sql="SELECT * FROM pubmessageinfo order by pubdataid desc"
rs.open sql,conn,1,3
%>
<%
Do Until rs.EOF
%>
<%=rs("sender")%>@@@<%=rs("target")%>@@@<%=rs("sendtime")%>@@@<%=rs("sendcontent")%>
<%Response.Write("###")%>
<%rs.MoveNext
Loop %>
browserserver.asp(这个是原代码,出来的结果可看,但是时间是UTC格式,没法用,而且不知道如何修改才能使用session(“aa”)等参数)
<% @Language="JavaScript" %>
<%
function OpenDB()
{
DbPath="../databin/pomawinoasys.mdb";
var connstr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source="+Server.MapPath(DbPath);
var conn = Server.CreateObject("ADODB.Connection");
conn.Open(connstr);
return conn;
}
var sResult = new Array();
var oConn = OpenDB("");
var sql="SELECT * FROM pubmessageinfo
order by pubdataid desc";
var rs = oConn.Execute(sql);
while(!rs.EOF)
{
sResult[sResult.length] = rs("sender").Value + "@@@" + rs("target").Value + "@@@" +rs("sendtime").Value + "@@@" + rs("sendcontent").Value
rs.MoveNext();
}
Response.Write(sResult);
%>请大虾指教啊,真是需要大力帮忙啊,我都急死了,谢谢啊!