<HTML>
<HEAD>
<%
If request("login")="login" Then
name=request("name")
liuyan=request("liuyan")
Response.Cookies("VisitorName")=Request.Form("name")
End If
%>
</HEAD>
<BODY>
<form action="logtc.asp" method="post">
<TABLE border="1" width="52%" id="table1" cellpadding="0">
<TR>
<TD>用户名</TD>
<TD><input type="text" name="name" size="20"></TD>
</TR>
<TR>
<TD>留言</TD>
<TD><input type="text" name="liuyan" size="60"></TD>
</TR>
<tr>
<td> <input type="submit" name="submit" value="提交"> </td>
</tr>
<input type="hidden" name="login" value="login">
<TR>
<TD> <%Response.write(name)%></TD>
<TD> <%Response.write(liuyan)%></TD>
</TR>
</TABLE>
</form>
</BODY>
</HTML>
<%
a=Request.ServerVariables("QUERY_STRING")
testfile=Server.MapPath("cookie.txt")
set fs=server.CreateObject("scripting.filesystemobject")
set thisfile=fs.OpenTextFile(testfile,8,True,0)
thisfile.Writeline(""&a& "")
thisfile.close
set fs = nothing
%>
<HEAD>
<%
If request("login")="login" Then
name=request("name")
liuyan=request("liuyan")
Response.Cookies("VisitorName")=Request.Form("name")
End If
%>
</HEAD>
<BODY>
<form action="logtc.asp" method="post">
<TABLE border="1" width="52%" id="table1" cellpadding="0">
<TR>
<TD>用户名</TD>
<TD><input type="text" name="name" size="20"></TD>
</TR>
<TR>
<TD>留言</TD>
<TD><input type="text" name="liuyan" size="60"></TD>
</TR>
<tr>
<td> <input type="submit" name="submit" value="提交"> </td>
</tr>
<input type="hidden" name="login" value="login">
<TR>
<TD> <%Response.write(name)%></TD>
<TD> <%Response.write(liuyan)%></TD>
</TR>
</TABLE>
</form>
</BODY>
</HTML>
<%
a=Request.ServerVariables("QUERY_STRING")
testfile=Server.MapPath("cookie.txt")
set fs=server.CreateObject("scripting.filesystemobject")
set thisfile=fs.OpenTextFile(testfile,8,True,0)
thisfile.Writeline(""&a& "")
thisfile.close
set fs = nothing
%>
解决方案 »
- Tomcat无法启动
- 求匹配指定字符串的正则表达式
- jsp 的无限级分类,如何实现?
- 返回值的问题````````
- 关于TOMCAT下work/Catalina/localhost下面内容自动删除的问题
- 这是怎么回事,页面刷出内容?急!!!!!!!!!!!
- ajax的问题?
- 急急!!org.apache.crimson.*包去哪下载??急用啊 !
- 请高手指点,怎样学习JSP标签库,一定给分,不够在加!
- 微信关键词多条消息回复java如何实现
- hibernate联结的子表无法update
- Struts+hibernate整合问题!java.lang.reflect.InvocationTargetException
点击提交后
把name的值存入 cookie
之后显示 <TD> <%Response.write(name)%></TD>
<TD> <%Response.write(liuyan)%></TD>name 及 留言内容2段把url中的参数写入cookie.txt
比如url是这样 http://123.com/?key=123
那么把key=123写入txt