<%@LANGUAGE="VBSCRIPT"%> <% ' *** Restrict Access To Page: Grant or deny access to this page MM_authorizedUsers="" MM_authFailedURL="login.asp" MM_grantAccess=false If Session("MM_Username") <> "" Then If (true Or CStr(Session("MM_UserAuthorization"))="") Or _ (InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then MM_grantAccess = true End If End If If Not MM_grantAccess Then MM_qsChar = "?" If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&" MM_referrer = Request.ServerVariables("URL") if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString() MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer) Response.Redirect(MM_authFailedURL) End If %> <% // *** Restrict Access To Page: Grant or deny access to this page var MM_authorizedUsers=""; var MM_authFailedURL="login.asp"; var MM_grantAccess=false; if (String(Session("MM_Username")) != "undefined") { if (true || (String(Session("MM_UserAuthorization"))=="") || (MM_authorizedUsers.indexOf(String(Session("MM_UserAuthorization"))) >=0)) { MM_grantAccess = true; } } if (!MM_grantAccess) { var MM_qsChar = "?"; if (MM_authFailedURL.indexOf("?") >= 0) MM_qsChar = "&"; var MM_referrer = Request.ServerVariables("URL"); if (String(Request.QueryString()).length > 0) MM_referrer = MM_referrer + "?" + String(Request.QueryString()); MM_authFailedURL = MM_authFailedURL + MM_qsChar + "accessdenied=" + Server.URLEncode(MM_referrer); Response.Redirect(MM_authFailedURL); } %> <% ' Some Global Functions Function ChkString(string) if String = "" then string = " " string = replace(string, "'", "''") ChkString = string End Function %> Add <% ' Procedure to Add a Forum to the database Sub add_forum set my_conn= Server.CreateObject("ADODB.Connection") my_Conn.Open ConnString strSql = "Select * from forum where forum_id = " & Request.Form("forum") set rs = my_conn.Execute (strSql) tmpName = rs("F_Name") tmpDescription = rs("F_Description") tmpCat = rs("F_Cat") tmpMod = rs("F_Moderator") rs.close %>

Agregar Foro

" name="id">
Nombre del Foro:
Descripción del Foro:

Categoría del Foro:
Moderador del Foror :
<% End Sub Sub Update_Forum set my_conn= Server.CreateObject("ADODB.Connection") my_Conn.Open ConnString strSql = "UPDATE forum SET f_name = '" & chkString(Request.Form("name")) & "', " strSql = StrSql & "f_Description = '" & chkString(Request.Form("description")) & "', " strSql = StrSql & "f_cat = " & Request.Form("category") & ", " strSql = StrSql & "f_moderator = " & Request.Form("moderator") strSql = StrSql & " WHERE forum_id = " & Request.Form("id") ' Response.Write StrSql my_conn.Execute StrSql my_conn.close set my_conn = nothing Response.Write "

Forum Updated

" End Sub %> <% Select Case Request.QueryString("mode") case "doit" call Update_Forum case "show" call add_forum case Else Response.Write "Error" End Select %>