ASP CHAT

来源:互联网 发布:软件退税账务处理 编辑:程序博客网 时间:2024/03/29 17:15

<%
disable=0   '開關此頁面
if trim(request.ServerVariables("REMOTE_ADDR"))<>"172.17.5.199" and trim(request.ServerVariables("REMOTE_ADDR"))<>"172.16.3.0" and trim(request.ServerVariables("REMOTE_ADDR"))<>"127.0.0.1" then
'response.redirect("http://itd016")
end if
%>
<%if disable=1 then%>
<script language="javascript">
window.close();
</script>
<%
response.end
end if%> 
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<LINK href="style.css" rel=stylesheet>
<style type="text/css">
<!--
body {
 background-image: url(bg01.gif);
 margin-left: 0px;
 margin-top: 5px;
 margin-right: 0px;
}
TD {
 FONT-SIZE: 9pt; LINE-HEIGHT: 12pt
}
A:hover {
 COLOR: #d05c00; TEXT-DECORATION: none
}
A {
 TEXT-TRANSFORM: none; TEXT-DECORATION: none
}
.unnamed1 {
 COLOR: #cccccc
}
.style2 {
 font-size: 14pt;
 color: #999999;
}
.style4 {color: #FF66FF}
.style8 {color: #00CCFF}
.style9 {font-size: 12px}
-->
</style>

<%
if application("count")="" then
application("count")=0
end if
if request("hidden")=1 then
if trim(request("myword"))<>"" and trim(request("myname"))<>"" then
application(application("count"))=trim(request("myname"))&":"&trim(request("myword"))
ok=1
application("word")=""
for i= 12 to 0 step -1
if trim(application(application("count")-i))<>"" then
application("word")=application("word")+application(application("count")-i)+chr(13)
end if
next
'application("word")=application("word")&application("count")
application("count")=application("count")+1
end if
end if
%>
<title>Test</title>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
<body onLoad="javascript:document.form1.myword.focus()" onkeydown="if(event.keyCode==13 && event.ctrlKey)form1.submit()">
  <div align="center" >
<font class="style2">This Is a Test...</font> 
<%if request("hidden")=1 and trim(request("myname"))="" then%>
<span class="style4">Note:name is empty...</span>
<%elseif request("hidden")=1 and trim(request("myword"))="" then%>
<span class="style4">Note:word is empty...</span>
<%elseif ok=1 then%>
<span class="style8">send OK...</span>
<%end if%><br>
 <iframe name="iframe1" width="545" height="270" src="word.asp" scrolling="no" frameBorder="0"></iframe>
    <form name="form1" method="post" action="">name
      <input class=text name="myname" type="text" id="myname" size="7" maxlength="10" value=<%=trim(request("myname"))%>>
      word:
      <input name="myword" id="myword" type="text" class=text size="30" maxlength="30">
      <input type="submit" name="Submit" value="Submit (Ctrl+Enter)">
    <a href="clear.asp?nameok=<%=trim(request("myname"))%>" class="style9">清空歷史</a>
      <input name="hidden" type="hidden" id="hidden" value="1">  
    </form>
  </div>
</body>

Word.asp

<meta http-equiv="Content-Type" content="text/html; charset=big5">
<meta http-equiv=refresh content='8;URL=word.asp'>
<LINK href="style.css" rel=stylesheet>


<style type="text/css">
<!--
body {
 background-image: url(bg02.gif);
}
TD {
 FONT-SIZE: 9pt; LINE-HEIGHT: 12pt
}
A:hover {
 COLOR: #d05c00; TEXT-DECORATION: none
}
A {
 TEXT-TRANSFORM: none; TEXT-DECORATION: none
}
.unnamed1 {
 COLOR: #cccccc
}
.style2 {
 font-size: 14pt;
 color: #999999;
}
-->
</style>
<%
if application("myfrist")="" then
application("myfrist")=application("word")
end if
%>
<form name="form1" method="post" action="">
<textarea class=text name="textarea" id="textarea" cols="72" rows="15"><%=application("word")%></textarea>
</form>
<%if application("myfrist")<>application("word") then%>
<script>
this.form1.textarea.focus 
</script>
<%end if%>
<%application("myfrist")=application("word")%>