<% ' Some Global Functions Function ChkString(string) if String = "" then string = " " string = replace(string, "'", "''") ChkString = string End Function %> Add <% ' Procedure to add A Category to the database Sub add_Cat ' Has the form been filled in? If request.QueryString("do_it") = "true" then set my_conn= Server.CreateObject("ADODB.Connection") my_Conn.Open ConnString StrSQl = "INSERT INTO category (cat_name) values ('" & ChkString(Request.Form("cat")) & "')" my_conn.Execute StrSql my_conn.close set my_conn = nothing Response.Write "

Category Added

" Else %>

Add a Category

Category to Add

<% End If End Sub ' Procedure to Add a Forum to the database Sub add_forum set my_conn= Server.CreateObject("ADODB.Connection") my_Conn.Open ConnString ' Has the form been filled in? If request.QueryString("do_it") = "true" then StrSQl = "INSERT INTO Forum (f_name, F_Description, F_Cat, F_Moderator ) values ('" StrSql = StrSql & Request.Form("name") & "', '" StrSql = StrSql & Request.Form("description") & "', " StrSql = StrSql & Request.Form("category") & ", " StrSql = StrSql & Request.Form("moderator") & ")" my_conn.Execute StrSql my_conn.close set my_conn = nothing Response.Write "

Category Added

" Else %>

Add Forum

Forum Name :
Forum Description :

Forum Caregory :
Forum Moderator :
<% End If End Sub %> <% Select Case Request.QueryString("mode") case "category" call add_Cat case "forum" call add_forum case Else Response.Write "Error" End Select %>