动网8.3 整合 个人网站

废话不多说,这几天在研究动网整合个人网站,在百度搜索了两天,发现就TM那几篇文章,按照文章弄的死去活来就是么搞好,“人生最痛苦的事就是你通宵去做事情,却没做好。。。”经过几天奋战终于攻破,所谓功夫不负有心人,大概就是这样。现在公布程序:

参考网站:第一货源    免费网店代理

/根目录:index.htmi、chklogin2.asp、conn.asp

/根目录/bbs/:动网程序

1首先修改cookie 通用名称

文件路径:bbs\inc\Dv_ClsMain.asp  第83行修改Forum_sn和CacheName,不要的注释掉

  'Forum_sn="DvForum 8.3"'如果一个虚拟目录或站点开多个论坛,则每个要错开,不能定义同一个名称
  'Forum_sn=Forum_sn & "_" & Request.servervariables("SERVER_NAME")
  Forum_sn="no1g"'如果一个虚拟目录或站点开多个论坛,则每个要错开,不能定义同一个名称
  CacheName="no1g"'如果一个虚拟目录或站点开多个论坛,则每个要错开,不能定义同一个名称

2修改cookie全站通用路径,动网限制只能在bbs目录下访问cookie,我们膝盖全站通用,有8处要修改

两个地方打开inc/Dv_ClsMain.asp 分别寻找 Response.Cookies(Forum_sn).path 和 Response.Cookies(Dvbbs.Forum_sn).path 将右侧的值均替换为"/" ,例: Response.Cookies(Forum_sn).path="/"

三个地方打开login.asp 寻找 Response.Cookies(Dvbbs.Forum_sn).path=Dvbbs.cookiepath 应该共有三个,其中一个是:Response.Cookies(Dvbbs.Forum_sn).path = Dvbbs.cookiepath(等号两旁有空格) 替换为: Response.Cookies(Dvbbs.Forum_sn).path="/"

一个地方打开logout.asp 寻找 Response.Cookies(Dvbbs.Forum_sn).path=Dvbbs.cookiepath 第27行应该只有一个替换为: Response.Cookies(Dvbbs.Forum_sn).path="/" 至此,修改完毕,即可以达到cookies全站通用的目的了

两个地方 打开reg.asp 寻找Response.Cookies(Dvbbs.Forum_sn).path=Dvbbs.cookiepath 替换Response.Cookies(Dvbbs.Forum_sn).path = "/"

3根目录登录文件index.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>首页</title>
</head>

<body>
<a href="bbs/index.asp">论坛</a>
<form id="form1" name="form1" method="post" action="chklogin2.asp">
 账户:<input type="text" name="username" />
 密码:<input type="password" name="password" />
 <input type="submit" name="Submit" value="提交" />
</form>
</body>
</html>

4登录验证文件chklogin2.asp

<!--#include file="conn.asp"-->
<!--#include file="bbs/inc/md5.asp"-->
<!--#include file="bbs/inc/const.asp"-->
<%
dim username,UserPassword,comeurl
username=trim(request.Form("UserName"))
UserPassword=trim(request.Form("password"))
response.write "提交"&username&"<br />"
response.write "提交"&UserPassword&"<br />"

if username="" then
response.Write "<script LANGUAGE='javascript'>alert('登录失败,请输入用户名!');location.href='"&comeurl&"';</script>"
conn.Close
set conn=nothing
response.end
end if

if UserPassword="" then
response.Write "<script LANGUAGE='javascript'>alert('登录失败,请输入密码!');location.href='"&comeurl&"';</script>"
conn.Close
set conn=nothing
response.end
end if

set rs=server.CreateObject("adodb.recordset")
rs.Open "Select * From [Dv_User] Where UserName='"&username&"'" ,conn,1,3
'如果用户存在
if not(rs.bof and rs.eof) then
    if rs("UserPassword")=MD5(UserPassword) then
  '设置用户登录cookie
  response.write "前台提交! <a href='bbs/index.asp'>论坛</a>"
  Response.Cookies("no1g").path="/"
  response.Write "userid:"&rs("userid")&"-"&"userclass:"&rs("userclass")&"-"&"username:"&rs("username")&"-"&"TruePassWord:"&rs("TruePassWord")&"-"
  Response.Cookies("no1g")("userid") = rs("userid")
  Response.Cookies("no1g")("usercookies") = "2"
  Response.Cookies("no1g")("userclass") = rs("userclass")
  Response.Cookies("no1g")("username") = rs("username")
  Response.Cookies("no1g")("userhidden") = 2
  Response.Cookies("no1g")("password") = rs("TruePassWord")
  Response.Cookies("no1g")("StatUserID") = Response.Cookies("no1g")("StatUserID")
  Response.Cookies("upNum")=0
  Response.Cookies("no1g").Expires=Date+31

  
 
  rem 清除图片上传数的限制
  Response.Cookies("upNum")=0
  response.write "登录成功! <a href='bbs/index.asp'>论坛</a>"

 else
  response.write "<script LANGUAGE='javascript'>alert('您输入的密码有误!');location.href='"&comeurl&"';</script>"
  response.end
 end if
 '跳转到你登陆的页面
else
 response.write "<script LANGUAGE='javascript'>alert('您输入的用户不存在!');location.href='"&comeurl&"';</script>"
 response.end
end if

rs.Close
set rs=nothing

conn.Close
set conn=nothing
%>

5数据库链接文件 conn.asp

<%
dim conn,connstr,startime,sundxDB,rs,UserAgent
startime=timer()
UserAgent = Trim(Lcase(Request.Servervariables("HTTP_USER_AGENT")))
If InStr(UserAgent,"teleport") > 0 or InStr(UserAgent,"webzip") > 0 or InStr(UserAgent,"flashget")>0 or InStr(UserAgent,"offline")>0 Then
 Response.Write "请不要采用teleport/Webzip/Flashget/Offline等工具来浏览商城!"
 Response.End
End If

'连接数据库
sundxDB="bbs/Data/Dvbbs83.mdb"
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&sundxDB&"")
On Error Resume Next
 Set conn = Server.CreateObject("ADODB.Connection")
 conn.open connstr
 If Err Then
  err.Clear
  Set Conn = Nothing
  Response.Write "数据库连接出错,请检查Conn.asp中的数据库指向。"'
  Response.End
 End If
%>

希望对大家有帮助,同时请尊敬他人劳动成果,转请注明来源联系本人请到
转:http://kuangshi2999898.blog.163.com/blog/static/8049935920103255556553/

posted @ 2011-03-18 18:52  ghd2004  阅读(484)  评论(0编辑  收藏  举报