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

首頁 > 編程 > ASP > 正文

一些簡單的ASP練習

2024-05-04 11:02:14
字體:
來源:轉載
供稿:網友
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)))%>


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 桦南县| 静海县| 科技| 阳曲县| 甘孜县| 南安市| 资兴市| 南和县| 吴忠市| 南昌县| 延边| 麦盖提县| 临猗县| 嘉祥县| 石河子市| 邹城市| 茌平县| 岚皋县| 天峨县| 长泰县| 莱阳市| 和田市| 侯马市| 宝山区| 罗定市| 山丹县| 台安县| 泸定县| 花垣县| 临潭县| 文昌市| 庄河市| 改则县| 武隆县| 平塘县| 凤台县| 托里县| 白朗县| 康保县| 高尔夫| 永靖县|