menu.asp, this is the front desk Executive Section .
The following is a reference fragment: QUOTE: <% ' Read XML file functions Function Ycms_menu () Dim menu_temp,m Set goxml=server.createobject ("Microsoft.XMLDOM") Goxml.load (Server.MapPath ("Menu.xml")) Set goroot=goxml.documentelement.selectsinglenode ("menu") M=0 For each child in Goroot.childnodes Set Childmenu=goroot.childnodes.item (m) Dim Menu_open,menu_title,menu_url Menu_open=childmenu.getattributenode ("Open"). NodeValue Menu_name=childmenu.getattributenode ("name"). NodeValue Menu_url=goroot.childnodes.item (m). Text ' Judge whether it is a pop-up window If menu_open=0 Then ' Decide if it's the first one, and if it's the first one, get rid of ' ┊ ' If m=0 Then menu_temp=menu_temp& "" &menu_name& "" Else menu_temp=menu_temp& "┊" &menu_name& "" End If Else If m=0 Then menu_temp=menu_temp& "" &menu_name& "" Else menu_temp=menu_temp& "┊" &menu_name& "" End If End If Set childmenu=nothing M=m+1 Next Set goroot=nothing Set goxml=nothing Ycms_menu=menu_temp End Function ' Output XML menu Response.Write (Ycms_menu ()) %> |
menu.xml XML data File
The following is a reference fragment: QUOTE: index.asp News.asp Art.asp Pic.asp Dj.asp Down.asp Book.asp Link.asp |
admin_menu.asp Admin XML file section
The following is a reference fragment: QUOTE: <% ' Save files with Ado.stream component Function Save (File_body,file_name) Set os=server.createobject ("ADODB. Stream ") OS. type=2 OS. Open OS. charset= "GB2312" OS. Position=os. Size OS. Writetext=file_body OS. SaveToFile Server.MapPath (file_name), 2 OS. Close Set os=nothing End Function If Request.QueryString ("action") = "OK" then Call Save (Request.Form ("content"), "Menu.xml") End If %> <br /><%=server.execute ("Menu.xml")%><br /><br /><input type= ' Submit ' value= ' modify '/><br /><br /><br /></td></tr></tbody></table><br /> <br /> |