如何在ASP中恰當(dāng)?shù)剡\(yùn)用Cookies?
remberme.asp
' 用戶提交個人信息.
<%
response.Cookies("information")("姓名")=request.form("name")
response.Cookies("information")("顧客號")=request.form("id")
response.Cookies("information")("來自")=request.form("from")
……
' 定義一個名為information的Cookies字典,你可以定義更多,如果你需要.
%>
<html>
<head>
<title>星河影動</title>
</head>
<body>
<div align="center"><center>
<table border="0" cellspacing="0" width="600" height="86">
<tr>
<td height="65"><p align="center"><font>星河影動之Cookies應(yīng)用</font></td>
</tr>
<tr>
<td align="center" height="62"><form method="post" action="remberme.asp">
<p><font>
姓名: <input type="text" name="name" size="20"> <br>
顧客號: <input type="text" name="id" size="20"> <br>
來自: <input type="text" name="nation" size="20">
</font><br>
<input type="submit" value="我想查詢">
<input type="reset" value="重寫">
</p>
</form>
</td>
</tr>
</table>
</center></div>
</body></html>
welcome.asp
' 顯示Cookies中的內(nèi)容.
<html>
<head>
<title>Cookies Demo</title>
</head>
<body>
姓名
<%=request.Cookies("information")("name")%>
<p>
顧客號
<%=request.Cookies("information")("id")%>
<p>
來自
<%=request.Cookies("information")("from")%>
</body></html>
相關(guān)文章
淺析Java、C/C++、JavaScript、PHP、Python分別用來開發(fā)什么?
用任何編程語言來開發(fā)程序,都是為了讓計算機(jī)干活,比如編寫一篇文章,下載一首MP3等,而計算機(jī)干活的CPU只認(rèn)識機(jī)器的指令,所以,盡管不同的編程語言差異極大,最后都得“翻譯”成CPU可以執(zhí)行的機(jī)器指令2018-08-08如何用下拉列表顯示數(shù)據(jù)庫里的內(nèi)容?
如何用下拉列表顯示數(shù)據(jù)庫里的內(nèi)容?...2006-11-11asp中在JScript中使用RecordSet對象的GetRows
asp中在JScript中使用RecordSet對象的GetRows...2007-03-03計算機(jī)網(wǎng)絡(luò)傳輸協(xié)議TCP三次握手與四次揮手原理
其實(shí)大家都聽過TCP三次握手建立連接,四次揮手?jǐn)嚅_連接,那我們今天就來具體看看,TCP到底是如何三次握手和四次揮手的,本文來為大家詳細(xì)解析2021-09-09