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

首頁 > 編程 > ASP > 正文

一些簡單的ASP練習

2024-05-04 10:58:38
字體:
來源:轉載
供稿:網友
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, ">", ">")
str = replace(str, "<", "<")
str = Replace(str, CHR(32), " ")
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)))%>


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 新源县| 灵寿县| 神木县| 基隆市| 连南| 昌平区| 朝阳区| 张家港市| 恩施市| 庆元县| 晋州市| 桑日县| 建宁县| 治多县| 襄城县| 德格县| 顺义区| 乳源| 嘉鱼县| 南雄市| 武冈市| 拉萨市| 资阳市| 遂川县| 马尔康县| 准格尔旗| 古浪县| 三门峡市| 青浦区| 山阳县| 邹平县| 威宁| 长泰县| 周至县| 南和县| 于都县| 怀集县| 闵行区| 合水县| 宁安市| 盐边县|