................................................................................. 17 5.5 Admin_index.asp (管理后台首页) ................................................................................................... 20 5.6 Admin_top.asp (顶部)........................................................................................................................ 21 5.7 Admin_left.asp (左侧菜单栏) ........................................................................................................... 22 5.8 Admin_blank.asp (右侧默认欢迎页) ............................................................................................... 24 5.9 Admin_admin.asp (管理员密码修改).............................................................................................. 25 5.10 Admin_newsadd.asp (新闻信息添加)............................................................................................ 27 5.11 Admin_newslist.asp (新闻信息列表)............................................................................................. 30 5.12 Admin_newsedit.asp (新闻信息修改) ........................................................................................... 32 5.13 Style.css (CSS样式) ........................................................................................................................ 35 观摩 原创 ASP做的简单新闻系统 1. 后台只有新闻的发布、编辑、删除功能 前台可显示新闻列表,浏览新闻 数据库为
Access2000 原始登录名:admin 密码:admin 2. 2.1 2.2 观摩 原创 ASP做的简单新闻系统 3 观摩 原创 ASP做的简单新闻系统 4 4.1 观摩 原创 ASP做的简单新闻系统 4.2 观摩 原创 ASP做的简单新闻系统 4.3 观摩 原创 ASP做的简单新闻系统 4.4 观摩 原创 ASP做的简单新闻系统 4.5 观摩 原创 ASP做的简单新闻系统 4.6 观摩 原创 ASP做的简单新闻系统 4.7 观摩 原创 ASP做的简单新闻系统 4.8 观摩 原创 ASP做的简单新闻系统 4.9 5 5.1 dbconn.asp lt QQ:94682957 ChenKunpeng dim conn 观摩 原创 ASP做的简单新闻系统 execDbConn Function execDbConn On Error Resume Next dim db dbquotdata/data.mdbquot 数据库文件的位置 Set conn Server.CreateObjectquotADODB.Connectionquot strconnquotProviderMicrosoft.Jet.OLEDB.4.0Data Sourcequot amp Server.MapPathdb conn.open strconn If Err Then err.Clear Set Conn Nothing Response.Write quot数据库连接出错,请检查连接字串。
quot Response.End End If End Function gt 观摩 原创 ASP做的简单新闻系统 5.2 Index.asp ltLANGUAGEquotVBSCRIPTquot CODEPAGEquot936quotgt lt QQ:94682957 ChenKunpeng gt lt--include filequotdbconn.aspquot --gt ltDOCTYPE html PUBLIC quot-//W3C//DTD XHTML 1.0 Transitional//ENquot quothttp://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtdquotgt lthtml xmlnsquothttp://www.w3.org/1999/xhtmlquotgt ltheadgt ltmeta http-equivquotContent-Typequot contentquottext/html charsetgb2312quot /gt lttitlegt新闻 - 首页lt/titlegt ltlink hrefquotstyle.cssquot relquotstylesheetquot typequottext/cssquot /gt lt/headgt ltbodygt lttable widthquot600quot borderquot0quot alignquotcenterquot cellpaddingquot2quot cellspacingquot1quot stylequotwidth:700px border:solid 1px 999999 background-color:efefef padding:5px margin:auto text-align:leftquotgt lttrgt lttdgtltspan classquotsubtitlequotgtXXXX新闻系统lt/spangt lthr /gt lt/tdgt lt/trgt lttrgt lttd heightquot400quot valignquottopquotgtlt Set Rs Conn.ExecutequotSelect id news_title news_subtime From news Order By id DESCquot01 Do While Not Rs.EOF gt ltp stylequotmargin:3px padding:1px font-size:14pxquotgt☆ lta hrefquotnewscontent.aspidlt Rsquotidquot gtquot targetquot_blankquotgt lt Rsquotnews_titlequot gt lt/agt lt Rsquotnews_subtimequot gt lt/pgt lt Rs.MOVENEXT Loop Set Rs Nothing 观摩 原创 ASP做的简单新闻系统 gtlt/tdgt lt/trgt lttrgt lttdgtampnbsp lta hrefquotadmin_index.aspquot targetquot_blankquotgt管理登陆lt/agt lt/tdgt lt/trgt lt/tablegt lt/bodygt lt/htmlgt 观摩 原创 ASP做的简单新闻系统 5.3 Newscontent.asp ltLANGUAGEquotVBSCRIPTquot CODEPAGEquot936quotgt lt QQ:94682957 ChenKunpeng gt lt--include filequotdbconn.aspquot --gt lt Set Rs Conn.ExecutequotSelect id news_title news_from news_subtime news_content From news where idquot amp Request.QueryStringquotidquot01 Dim content content Rsquotnews_contentquot content Replacecontent vblf quotltbr /gtquot content Replacecontent quot quot quotampnbsp quot gt ltDOCTYPE html PUBLIC quot-//W3C//DTD XHTML 1.0 Transitional//ENquot quothttp://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtdquotgt lthtml xmlnsquothttp://www.w3.org/1999/xhtmlquotgt ltheadgt ltmeta http-equivquotContent-Typequot contentquottext/html charsetgb2312quot /gt lttitlegtlt Rsquotnews_titlequot gtlt/titlegt ltlink hrefquotstyle.cssquot relquotstylesheetquot typequottext/cssquot /gt lt/headgt ltbody stylequottext-align:centerquotgt ltdiv stylequotwidth:700px border:solid 1px 999999 background-color:efefef padding:5px margin:auto text-align:leftquotgt ltdiv classquotsubtitlequot stylequottext-align:center height:40px line-height:40pxquotgt lt Rsquotnews_titlequot gt lt/divgt ltdiv stylequottext-align:center background-color:dedede quotgt lt Rsquotnews_fromquot gt lt Rsquotnews_subtimequot gt lt/divgt ltdivgt lt content gt lt/divgt lt/divgt lt/bodygt 观摩 原创 ASP做的简单新闻系统 lt/htmlgt 5.4 Login.asp ltLANGUAGEquotVBSCRIPTquot CODEPAGEquot936quotgt lt QQ:94682957 ChenKunpeng gt lt--include filequotdbconn.aspquot --gt lt If Request.QueryStringquotdoquot quotloginquot Then Dim m_name m_password m_name Request.Formquotm_namequot m_password Request.Formquotm_passwordquot If m_name quotquot Or m_password quotquot Then Response.Writequotltscriptgtalertquotquot用户名密码为空,请返回quotquothistory.backlt/scriptgtquot Response.End End If Dim SqlString SqlString quotSelect countid From admin Where m_namequot amp m_name amp quot AND m_passwordquot amp m_password amp quotquot Response.WriteSqlString Response.End Set CRs conn.ExecuteSqlString 0 1 If CRs0 1 Then Sessionquotisloginquot quot1quot Sessionquotm_namequot m_name Response.Redirectquotadmin_index.aspquot Else Response.Writequotltscriptgtalertquotquot登陆失败,请返回quotquothistory.backlt/scriptgtquot Response.End End If ElseIf Request.QueryStringquotdoquot quotlogoutquot Then Sessionquotisloginquot quotquot Response.Redirectquotlogin.aspquot End If gt 观摩 原创 ASP做的简单新闻系统 ltDOCTYPE html PUBLIC quot-//W3C//DTD XHTML 1.0 Transitional//ENquot quothttp://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtdquotgt lthtml xmlnsquothttp://www.w3.org/1999/xhtmlquotgt ltheadgt ltmeta http-equivquotContent-Typequot contentquottext/html charsetgb2312quot /gt lttitlegt管理登陆lt/titlegt ltlink hrefquotstyle.cssquot relquotstylesheetquot typequottext/cssquot /gt lt/headgt ltbodygt ltpgtampnbsplt/pgt lttable widthquot100quot borderquot0quot alignquotcenterquot cellpaddingquot0quot cellspacingquot0quotgt lttrgt lttd heightquot400quotgtltform idquotform1quot namequotform1quot methodquotpostquot actionquotdologinquotgt lttable widthquot400quot borderquot0quot alignquotcenterquot cellpaddingquot0quot cellspacingquot0quotgt lttrgt lttdgtampnbsplt/tdgt lttdgtampnbsplt/tdgt lttdgtampnbsplt/tdgt lt/trgt lttrgt lttdgtampnbsplt/tdgt lttd widthquot370quotgtlttable widthquot100quot borderquot0quot cellspacingquot1quot cellpaddingquot2quotgt lttrgt lttd colspanquot2quot alignquotcenterquot classquottitlequotgt管理登陆lt/tdgt lt/trgt lttrgt lttd colspanquot2quotgtampnbsplt/tdgt lt/trgt lttrgt lttd alignquotrightquotgt登陆名:lt/tdgt lttdgtltinput namequotm_namequot typequottextquot idquotm_namequot stylequotwidth:160pxquot /gtlt/tdgt lt/trgt lttrgt lttd alignquotrightquotgt登陆密码:lt/tdgt lttdgtltinput namequotm_passwordquot typequotpasswordquot idquotm_passwordquot stylequotwidth:160pxquot /gtlt/tdgt lt/trgt lttrgt lttd heightquot40quot colspanquot2quot alignquotcenterquotgtltinput typequotsubmitquot namequotSubmitquot valuequot登 陆quot /gtlt/tdgt lt/trgt lttrgt 观摩 原创 ASP做的简单新闻系统 lttd colspanquot2quot alignquotcenterquotgtampnbsplt/tdgt lt/trgt lt/tablegtlt/tdgt lttdgtampnbsplt/tdgt lt/trgt lttrgt lttdgtampnbsplt/tdgt lttdgtampnbsplt/tdgt lttdgtampnbsplt/tdgt lt/trgt lt/tablegt lt/formgt lt/tdgt lt/trgt lt/tablegt ltpgtampnbsplt/pgt lt/bodygt lt/htmlgt 观摩 原创 ASP做的简单新闻系统 5.5 Admin_index.asp lt If Sessionquotisloginquot ltgt quot1quot Then Response.Redirectquotlogin.aspquot Response.End End If gt ltDOCTYPE html PUBLIC quot-//W3C//DTD XHTML 1.0 Frameset//ENquot quothttp://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtdquotgt lthtml xmlnsquothttp://www.w3.org/1999/xhtmlquotgt ltheadgt ltmeta http-equivquotContent-Typequot contentquottext/html charsetgb2312quot /gt lttitlegt新闻系统管理lt/titlegt lt/headgt ltframeset rowsquot50quot colsquotquot frameborderquotnoquot borderquot0quot framespacingquot0quotgt ltframe srcquotadmin_top.aspquot namequottopFramequot scrollingquotNoquot noresizequotnoresizequot idquottopFramequot titlequottopFramequot /gt ltframeset rowsquotquot colsquot120quot framespacingquot0quot frameborderquotnoquot borderquot0quotgt ltframe srcquotadmin_left.aspquot namequotleftFramequot scrollingquotNoquot noresizequotnoresizequot idquotleftFramequot titlequotleftFramequot /gt ltframe srcquotadmin_blank.aspquot namequotmainFramequot idquotmainFramequot titlequotmainFramequot /gt lt/framesetgt lt/framesetgt ltnoframesgtltbodygt lt/bodygt lt/noframesgtlt/htmlgt 观摩 原创 ASP做的简单新闻系统 5.6 Admin_top.asp ltLANGUAGEquotVBSCRIPTquot CODEPAGEquot936quotgt lt QQ:94682957 ChenKunpeng gt lt If Sessionquotisloginquot ltgt quot1quot Then Response.Redirectquotlogin.aspquot Response.End End If gt ltDOCTYPE html PUBLIC quot-//W3C//DTD XHTML 1.0 Transitional//ENquot quothttp://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtdquotgt lthtml xmlnsquothttp://www.w3.org/1999/xhtmlquotgt ltheadgt ltmeta http-equivquotContent-Typequot contentquottext/html charsetgb2312quot /gt lttitlegtAdmin_Toplt/titlegt ltlink hrefquotstyle.cssquot relquotstylesheetquot typequottext/cssquot /gt lt/headgt ltbody stylequotbackground-color:CCCCCCquotgt ltspan classquotsubtitlequotgt新闻管理系统lt/spangt lt/bodygt lt/htmlgt 观摩 原创 ASP做的简单新闻系统 5.7 Admin_left.asp ltLANGUAGEquotVBSCRIPTquot CODEPAGEquot936quotgt lt QQ:94682957 ChenKunpeng gt lt If Sessionquotisloginquot ltgt quot1quot Then Response.Redirectquotlogin.aspquot Response.End End If gt ltDOCTYPE html PUBLIC quot-//W3C//DTD XHTML 1.0 Transitional//ENquot quothttp://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtdquotgt lthtml xmlnsquothttp://www.w3.org/1999/xhtmlquotgt ltheadgt ltmeta http-equivquotContent-Typequot contentquottext/html charsetgb2312quot /gt lttitlegt无标题文档lt/titlegt ltlink hrefquotstyle.cssquot relquotstylesheetquot typequottext/cssquot /gt lt/headgt ltbodygt lttable widthquot100quot borderquot0quot cellspacingquot0quot cellpaddingquot0quotgt lttrgt lttdgtlta hrefquotadmin_index.aspquot targetquot_parentquotgt管理首页lt/agt lta hrefquotlogin.aspdologoutquot targetquot_parentquotgt退出lt/agtlt/tdgt lt/trgt lttrgt lttdgtampnbsplt/tdgt lt/trgt lt/tablegt lttable widthquot100quot borderquot0quot cellspacingquot0quot cellpaddingquot0quotgt lttrgt lttdgt★ lta hrefquotadmin_admin.aspquot targetquotmainFramequotgt管理员管理lt/agtlt/tdgt lt/trgt lttrgt lttdgtampnbsplt/tdgt lt/trgt lt/tablegt lttable widthquot100quot borderquot0quot cellspacingquot0quot cellpaddingquot0quotgt 观摩 原创 ASP做的简单新闻系统 lttrgt lttdgt★ lta hrefquotadmin_newsadd.aspquot targetquotmainFramequotgt新闻添加lt/agtlt/tdgt lt/trgt lttrgt lttdgt★ lta hrefquotadmin_newslist.aspquot targetquotmainFramequotgt新闻列表lt/agtlt/tdgt lt/trgt lttrgt lttdgtampnbsplt/tdgt lt/trgt lt/tablegt lt/bodygt lt/htmlgt 观摩 原创 ASP做的简单新闻系统 5.8 Admin_blank.asp ltLANGUAGEquotVBSCRIPTquot CODEPAGEquot936quotgt lt QQ:94682957 ChenKunpeng gt lt If Sessionquotisloginquot ltgt quot1quot Then Response.Redirectquotlogin.aspquot Response.End End If gt ltDOCTYPE html PUBLIC quot-//W3C//DTD XHTML 1.0 Transitional//ENquot quothttp://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtdquotgt lthtml xmlnsquothttp://www.w3.org/1999/xhtmlquotgt ltheadgt ltmeta http-equivquotContent-Typequot contentquottext/html charsetgb2312quot /gt lttitlegt无标题文档lt/titlegt ltlink hrefquotstyle.cssquot relquotstylesheetquot typequottext/cssquot /gt lt/headgt ltbodygt lttable widthquot100quot borderquot0quot cellspacingquot0quot cellpaddingquot0quotgt lttrgt lttd heightquot400quot alignquotcenterquot classquotsubtitlequotgtWelcomelt/tdgt lt/trgt lt/tablegt lt/bodygt lt/htmlgt 观摩 原创 ASP做的简单新闻系统 5.9 Admin_admin.asp ltLANGUAGEquotVBSCRIPTquot CODEPAGEquot936quotgt lt QQ:94682957 ChenKunpeng gt lt--include filequotdbconn.aspquot --gt lt If Sessionquotisloginquot ltgt quot1quot Then Response.Redirectquotlogin.aspquot Response.End End If gt ltDOCTYPE html PUBLIC quot-//W3C//DTD XHTML 1.0 Transitional//ENquot quothttp://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtdquotgt lthtml xmlnsquothttp://www.w3.org/1999/xhtmlquotgt ltheadgt ltmeta http-equivquotContent-Typequot contentquottext/html charsetgb2312quot /gt lttitlegt管理员管理lt/titlegt ltlink hrefquotstyle.cssquot relquotstylesheetquot typequottext/cssquot /gt lt/headgt ltbodygt lt If Request.QueryStringquotdoquot quotsubquot Then Dim mp1 mp2 mp1 Request.Formquotm_passwordquot mp2 Request.Formquotm_password2quot If mp1 quotquot Then Response.Writequotltscriptgtalertquotquot请输入您要修改的新密码quotquothistory.backlt/scriptgtquot Response.End End If If mp1 ltgt mp2 Then Response.Writequotltscriptgtalertquotquot两次输入的密码不一致quotquothistory.backlt/scriptgtquot Response.End End If Conn.ExecutequotUPDATE admin SET m_passwordquot amp mp1 amp quot WHERE m_namequot amp Sessionquotm_namequot amp quotquot Response.Writequotltscriptgtalertquotquot密码修改成功quotquothistory.backlt/scriptgtquot 观摩 原创 ASP做的简单新闻系统 Response.End End If gt lttable widthquot400quot borderquot0quot alignquotcenterquot cellpaddingquot0quot cellspacingquot0quotgt lttrgt lttdgtltform idquotform1quot namequotform1quot methodquotpostquot actionquotdosubquotgt lttable widthquot400quot borderquot0quot alignquotcenterquot cellpaddingquot2quot cell.