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

首頁 > 編程 > ASP > 正文

ASP的簡單練習

2024-05-04 11:05:28
字體:
來源:轉載
供稿:網友

ASP是用來創建動態交互式網頁并建立強大的web應用程序,但是很多小伙伴們在學習ASP的時候都不知道應該怎么入手,那么我們現在就去看看小編整理的ASP的簡單練習。

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


以上就是關于ASP的簡單練習,希望對大家的學習有所幫助,也希望大家多多支持錯新技術頻道。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 花垣县| 靖西县| 三河市| 汉阴县| 合作市| 治多县| 平乐县| 绵阳市| 老河口市| 读书| 尤溪县| 远安县| 梁平县| 通州区| 绍兴市| 资阳市| 河南省| 保康县| 镶黄旗| 河北区| 报价| 略阳县| 缙云县| 璧山县| 景德镇市| 苗栗市| 许昌县| 武穴市| 高雄县| 贵阳市| 隆德县| 当涂县| 古交市| 搜索| 安新县| 龙州县| 海门市| 祥云县| 阿合奇县| 石阡县| 伊吾县|