最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

一些簡(jiǎn)單的ASP練習(xí)

 更新時(shí)間:2007年01月03日 00:00:00   作者:  
1,練習(xí)使用request對(duì)象接受數(shù)據(jù),并且綜合運(yùn)用些函數(shù)。

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")%>

文章標(biāo)題:<%=th(title)%><hr>
文章內(nèi)容:<%=encode(th(content))%>


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

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

增強(qiáng)的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")%>

文章標(biāo)題:<%=th(title)%><hr>
文章內(nèi)容:<%=ubb(unhtml(th(content)))%>


相關(guān)文章

最新評(píng)論

顺昌县| 滨州市| 沙田区| 乐清市| 肥西县| 永顺县| 卢龙县| 东乡| 长治市| 休宁县| 吉林市| 图们市| 巢湖市| 广水市| 远安县| 临高县| 韶山市| 宁海县| 健康| 广平县| 杭锦后旗| 鹤庆县| 长沙市| 安溪县| 美姑县| 闸北区| 南郑县| 淮滨县| 安平县| 梁平县| 嘉黎县| 乐安县| 聂拉木县| 安多县| 施甸县| 平利县| 肇东市| 雅安市| 江达县| 肥西县| 若羌县|