⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 publisharticle.asp

📁 集合了学习asp的100个实例
💻 ASP
字号:
<%@language=vbscript%>

<!--#include virtual="adovbs.inc"-->

<html>

<head>

</head>

<body bgcolor=#c1f7d8>

<center>

<%

dim strArticletitle,strarticlecontent,strarticleauthor,strarticleid

dim strtable,strdsn

if session("name")="" then

    response.write "请你首先登录,才能发表高见"

    response.end

end if

strarticletitle=request.form("title")

strarticlecontent=request.form("content")

strarticleauthor=session("name")

strarticleid=Request.Form("articleid")

strtable="article"

strdsn="dsn=bbs;uid=feng;pwd=feng"

if trim(strarticletitle)="" then

    response.write "主题不能为空"

    response.end

end if

if trim(strarticlecontent)="" then

    strarticletitle=strarticletitle & "(无内容)"

end if

set rs=server.createobject("adodb.recordset")

rs.open strtable,strdsn,3,2

rs.addnew

if request.form("submit")="发表文章" then

    rs("articletitle")=strarticletitle

    rs("articleauthor")=strarticleauthor

    rs("articlecontent")=strarticlecontent

    response.write "文章发表成功"

elseif request.form("submit")="跟贴文章" then

    rs("articletitle")=strarticletitle

    rs("articleauthor")=strarticleauthor

    rs("articlecontent")=strarticlecontent

    rs("articleparent")=strarticleid

end if

rs.update

rs.close

set rs=nothing

%>

<%

'修改跟贴文章数

if request.form("submit")="跟贴文章" then

    strchangesql="update article set articlefellownumber=articlefellownumber+1 where articleid=" & strarticleid

    strconn="dsn=bbs;uid=feng;pwd=feng"

    set conn=server.createobject("adodb.connection")

    conn.open strconn

    set rs=conn.execute(strchangesql)

    set rs=nothing

    conn.close

    set conn=nothing

    response.write "文章成功跟贴"

end if

%>

</body>

</html>



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -