国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASP > 正文

一些簡單的ASP練習

2020-07-27 13:19:18
字體:
來源:轉載
供稿:網友
1,練習使用request對象接受數據,并且綜合運用些函數。

cnbruce.html

<form action="cnbruce.asp" method="post">
<input type="text" name="title"><br>
<textarea name="content" rows=10 cols=20></textarea><br>
<input type="submit">
</form>


cnbruce.asp

<%
function th(str)
str=replace(str,"媽的","MD")
str=replace(str,"靠","KAO")
th=str
end function

function encode(str)
str = replace(str, ">", "&gt;")
str = replace(str, "<", "&lt;")
str = Replace(str, CHR(32), "&nbsp;")
str = Replace(str, CHR(13), "")
str = Replace(str, CHR(10) & CHR(10), "</P><P>")
str = Replace(str, CHR(10), "<BR>")
encode=str
end function
%>

<%title=request.form("title")
content=request.form("content")%>

文章標題:<%=th(title)%><hr>
文章內容:<%=encode(th(content))%>


th(str)為自定義函數,主要功能很簡單:過濾字符。encode(str)也為自定義函數,主要功能是完整地顯示被傳遞的信息。
CHR(10)表示換行,CHR(13)表示回車,CHR(32)表示空格。

附加功能:顯示UBB代碼。
即ubb.asp中含有ubb()函數。

增強的cnbruce.asp

<!--#include file="http://www.cnbruce.com/blog/ubb.asp"-->
<%
function th(str)
str=replace(str,"媽的","MD")
str=replace(str,"靠","KAO")
th=str
end function
%>

<script>
function runEx(cod1) {
cod=document.all(cod1)
var code=cod.value;
if (code!=""){
var newwin=window.open('','','');
newwin.opener = null
newwin.document.write(code);
newwin.document.close();
}
}
</script>

<%title=request.form("title")
content=request.form("content")%>

文章標題:<%=th(title)%><hr>
文章內容:<%=ubb(unhtml(th(content)))%>


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 巴林左旗| 福贡县| 瓦房店市| 鹰潭市| 重庆市| 苍溪县| 奉贤区| 扶绥县| 霍邱县| 福泉市| 沙田区| 苍南县| 定南县| 胶南市| 汤阴县| 永顺县| 保靖县| 新宁县| 纳雍县| 增城市| 香港 | 永丰县| 邻水| 长治市| 手机| 宁国市| 堆龙德庆县| 靖西县| 吉木萨尔县| 广宁县| 龙陵县| 陇南市| 历史| 佛坪县| 炉霍县| 西青区| 镇远县| 定兴县| 九台市| 万盛区| 洛浦县|