欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

一些簡(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)論