config.asp 里面的参数如何通过asp修改呢?
<%'环境常量不用修改该constshangdo_fso="Scripting.FileSystemObject"constshangdo_stm="ADODB.Stre...
<%
'环境常量 不用修改该
const shangdo_fso = "Scripting.FileSystemObject"
const shangdo_stm = "ADODB.Stream"
const shangdo_xmldom = "Microsoft.XMLDOM"
const shangdo_codepage = "utf-8"
const shangdo_path = "../template" '
const shangdo_templates="../../template"
const shangdo_default_template = ""
'网站信息
const shangdo_title="标题"
const shangdo_description="描述"
const shangdo_keywords="关键词"
const virtual_path=""
%>
以上是我的config里面的代码.
如何通过一个asp文件直接修改 标题呢,,描述..和关键词呢????? 展开
'环境常量 不用修改该
const shangdo_fso = "Scripting.FileSystemObject"
const shangdo_stm = "ADODB.Stream"
const shangdo_xmldom = "Microsoft.XMLDOM"
const shangdo_codepage = "utf-8"
const shangdo_path = "../template" '
const shangdo_templates="../../template"
const shangdo_default_template = ""
'网站信息
const shangdo_title="标题"
const shangdo_description="描述"
const shangdo_keywords="关键词"
const virtual_path=""
%>
以上是我的config里面的代码.
如何通过一个asp文件直接修改 标题呢,,描述..和关键词呢????? 展开
展开全部
改到数据库里,在数据库里加个表名config
里面字段
title,description,keywords,path
再做一个config2.asp里做成修改内容的后台
<%
Set
conn
=
Server.CreateObject("ADODB.Connection")
Connstr="DBQ="+server.mappath("数据库.mdb")+";DefaultDir='';DRIVER={Microsoft
Access
Driver
(*.mdb)};DriverId=25;FIL=MS
Access;ImplicitCommitSync=Yes;MaxBufferSize=512;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;Threads=3;UserCommitSync=Yes;"
conn.Open
connstr
'上面连接数据库部分你自己改成你自己的
if
request("action")="save"
then
title
=
request("title")
description1
=
request("description1")
keywords
=
request("keywords")
path
=
request("path")
set
rs
=
server.createobject("adodb.recordset")
sql="select
*
from
[hldtg]
where
d"
rs.open
sql,conn,1,3
rs("title")=
title
rs("description")=
description1
rs("keywords")=
keywords
rs("path")=
path
rs.update
rs.close
end
if
%>
<%
set
rs
=
server.createobject("adodb.recordset")
sql="select
*
from
[config]"
rs.open
sql,conn,1,1
title=rs("title")
description1=rs("description")
keywords=rs("keywords")
path=rs("path")
rs.close
%>
<form
action="?action=save"
method="post">
标题:<input
name="title"
type="text"
value="<%=title%>"
/><br
/>
描述:<input
name="description1"
type="text"
value="<%=description1%>"
/><br
/>
关键词:<input
name="keywords"
type="text"
value="<%=keywords%>"
/><br
/>
地址:<input
name="path"
type="text"
value="<%=path%>"
/><br
/>
<input
name="submit"
type="submit"
value="修改"
/>
</form>
里面字段
title,description,keywords,path
再做一个config2.asp里做成修改内容的后台
<%
Set
conn
=
Server.CreateObject("ADODB.Connection")
Connstr="DBQ="+server.mappath("数据库.mdb")+";DefaultDir='';DRIVER={Microsoft
Access
Driver
(*.mdb)};DriverId=25;FIL=MS
Access;ImplicitCommitSync=Yes;MaxBufferSize=512;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;Threads=3;UserCommitSync=Yes;"
conn.Open
connstr
'上面连接数据库部分你自己改成你自己的
if
request("action")="save"
then
title
=
request("title")
description1
=
request("description1")
keywords
=
request("keywords")
path
=
request("path")
set
rs
=
server.createobject("adodb.recordset")
sql="select
*
from
[hldtg]
where
d"
rs.open
sql,conn,1,3
rs("title")=
title
rs("description")=
description1
rs("keywords")=
keywords
rs("path")=
path
rs.update
rs.close
end
if
%>
<%
set
rs
=
server.createobject("adodb.recordset")
sql="select
*
from
[config]"
rs.open
sql,conn,1,1
title=rs("title")
description1=rs("description")
keywords=rs("keywords")
path=rs("path")
rs.close
%>
<form
action="?action=save"
method="post">
标题:<input
name="title"
type="text"
value="<%=title%>"
/><br
/>
描述:<input
name="description1"
type="text"
value="<%=description1%>"
/><br
/>
关键词:<input
name="keywords"
type="text"
value="<%=keywords%>"
/><br
/>
地址:<input
name="path"
type="text"
value="<%=path%>"
/><br
/>
<input
name="submit"
type="submit"
value="修改"
/>
</form>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
改到数据库里,在数据库里加个表名config
里面字段 title,description,keywords,path
再做一个config2.asp里做成修改内容的后台
<%
Set conn = Server.CreateObject("ADODB.Connection")
Connstr="DBQ="+server.mappath("数据库.mdb")+";DefaultDir='';DRIVER={Microsoft Access Driver (*.mdb)};DriverId=25;FIL=MS Access;ImplicitCommitSync=Yes;MaxBufferSize=512;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;Threads=3;UserCommitSync=Yes;"
conn.Open connstr
'上面连接数据库部分你自己改成你自己的
if request("action")="save" then
title = request("title")
description1 = request("description1")
keywords = request("keywords")
path = request("path")
set rs = server.createobject("adodb.recordset")
sql="select * from [hldtg] where d"
rs.open sql,conn,1,3
rs("title")= title
rs("description")= description1
rs("keywords")= keywords
rs("path")= path
rs.update
rs.close
end if
%>
<%
set rs = server.createobject("adodb.recordset")
sql="select * from [config]"
rs.open sql,conn,1,1
title=rs("title")
description1=rs("description")
keywords=rs("keywords")
path=rs("path")
rs.close
%>
<form action="?action=save" method="post">
标题:<input name="title" type="text" value="<%=title%>" /><br />
描述:<input name="description1" type="text" value="<%=description1%>" /><br />
关键词:<input name="keywords" type="text" value="<%=keywords%>" /><br />
地址:<input name="path" type="text" value="<%=path%>" /><br />
<input name="submit" type="submit" value="修改" />
</form>
里面字段 title,description,keywords,path
再做一个config2.asp里做成修改内容的后台
<%
Set conn = Server.CreateObject("ADODB.Connection")
Connstr="DBQ="+server.mappath("数据库.mdb")+";DefaultDir='';DRIVER={Microsoft Access Driver (*.mdb)};DriverId=25;FIL=MS Access;ImplicitCommitSync=Yes;MaxBufferSize=512;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;Threads=3;UserCommitSync=Yes;"
conn.Open connstr
'上面连接数据库部分你自己改成你自己的
if request("action")="save" then
title = request("title")
description1 = request("description1")
keywords = request("keywords")
path = request("path")
set rs = server.createobject("adodb.recordset")
sql="select * from [hldtg] where d"
rs.open sql,conn,1,3
rs("title")= title
rs("description")= description1
rs("keywords")= keywords
rs("path")= path
rs.update
rs.close
end if
%>
<%
set rs = server.createobject("adodb.recordset")
sql="select * from [config]"
rs.open sql,conn,1,1
title=rs("title")
description1=rs("description")
keywords=rs("keywords")
path=rs("path")
rs.close
%>
<form action="?action=save" method="post">
标题:<input name="title" type="text" value="<%=title%>" /><br />
描述:<input name="description1" type="text" value="<%=description1%>" /><br />
关键词:<input name="keywords" type="text" value="<%=keywords%>" /><br />
地址:<input name="path" type="text" value="<%=path%>" /><br />
<input name="submit" type="submit" value="修改" />
</form>
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
使用下面的函数,Str为全文或者文章标题,keyword为关键词,如果str中含有keyword,则keyword变为红色
<%
Function GoRed(Str,keyword)
Dim RegObj
Set RegObj= New RegExp
With RegObj
.Global = True
.IgnoreCase = True
.Pattern="([.\n]*)("&Keyword&")([.\n]*)"
GoRed=.Replace(Str,"$1<font color='red'>$2</font>$3")
End With
Set RegObj=Nothing
End Function
%>
用法举例:GoRed("百度知道真好用","知道")
<%
Function GoRed(Str,keyword)
Dim RegObj
Set RegObj= New RegExp
With RegObj
.Global = True
.IgnoreCase = True
.Pattern="([.\n]*)("&Keyword&")([.\n]*)"
GoRed=.Replace(Str,"$1<font color='red'>$2</font>$3")
End With
Set RegObj=Nothing
End Function
%>
用法举例:GoRed("百度知道真好用","知道")
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
a.asp
<form action="config.asp">
<table><tr><td>标题:</td><td><input type="text" name="BT">
</td></tr><tr><td>描述:</td><td><input type="text" name="MS">
</td></tr><tr><td>关键词:</td><td><input type="text" name="GJC">
</td></tr></table><input type="submit" value="提交">
</FORM>
config.asp里
const shangdo_title="标题"
const shangdo_description="描述"
const shangdo_keywords="关键词"
const virtual_path=""
改为
bt=request("bt")
ms=request("ms")
gjc=request("gjc")
const shangdo_title='"&bt&"'
const shangdo_description='"&ms&"'
const shangdo_keywords='"&gjc&"'
const virtual_path=""
没有GW,样子你自己调一下
<form action="config.asp">
<table><tr><td>标题:</td><td><input type="text" name="BT">
</td></tr><tr><td>描述:</td><td><input type="text" name="MS">
</td></tr><tr><td>关键词:</td><td><input type="text" name="GJC">
</td></tr></table><input type="submit" value="提交">
</FORM>
config.asp里
const shangdo_title="标题"
const shangdo_description="描述"
const shangdo_keywords="关键词"
const virtual_path=""
改为
bt=request("bt")
ms=request("ms")
gjc=request("gjc")
const shangdo_title='"&bt&"'
const shangdo_description='"&ms&"'
const shangdo_keywords='"&gjc&"'
const virtual_path=""
没有GW,样子你自己调一下
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询