国产探花免费观看_亚洲丰满少妇自慰呻吟_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)))%>


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 炎陵县| 池州市| 乌拉特后旗| 伊宁县| 十堰市| 河津市| 波密县| 黎城县| 长沙县| 平武县| 桦南县| 宜都市| 南汇区| 交口县| 靖宇县| 贡山| 鄂尔多斯市| 马山县| 江西省| 固原市| 弋阳县| 中卫市| 太谷县| 东山县| 从江县| 苏州市| 雅安市| 澎湖县| 夏津县| 柳州市| 东乌珠穆沁旗| 缙云县| 醴陵市| 宝应县| 赤城县| 靖远县| 舟曲县| 广州市| 资溪县| 乌鲁木齐市| 阿拉尔市|