最新国产好看的视频,伊人天堂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)論

皋兰县| 平遥县| 望谟县| 辉南县| 西峡县| 科技| 含山县| 濮阳县| 库尔勒市| 虞城县| 霞浦县| 枣庄市| 密山市| 务川| 伊金霍洛旗| 临江市| 安塞县| 宁武县| 宿迁市| 福清市| 滨海县| 衢州市| 康马县| 庆云县| 峨边| 江北区| 玛曲县| 静宁县| 贵阳市| 西乌珠穆沁旗| 都匀市| 闵行区| 都安| 济阳县| 安龙县| 友谊县| 彭阳县| 宜宾县| 遂昌县| 临桂县| 江都市|