★ wanayoo — archive 1999 http://home.about.com/local/alaskahawaii/pform.htmNouvelle recherche | Portail wanayoo
shadow
Home
Thu, Jan  6,  2000
 
About.com
You are here: Home > Local > Alaska/Hawaii, US > Problem Form
 
Content: AboutToday | JustAbout
TalkAbout: Newsletters | Forums | Chat | Join
ShopAbout: ShopNow | Books | Videos | Yellow Pages
Section Name
Problem Form


<% ' IMPORTANT: The only difference between regular, chat, and bb pform code is the function call to DoProblemForm() below **** Response.Write(vbcrlf & "" & vbcrlf) ' globals (i.e. script scope) Dim status, firstname, lastname, email, browser, http_user_agent, os, ram, site, description, reproducible Dim sJSK_Font1 sJSK_Font1 = "" DoProblemForm("") ' regular problem form 'DoProblemForm("Chat") ' chat problem form 'DoProblemForm("Bulletin Board") ' bb problem form Response.Write(vbcrlf & "" & vbcrlf) %> <% Private Function DoProblemForm(sDescription) DoProblemForm = TRUE ' always returns TRUE Dim sDSN, sDbTable Dim sBullet, assoc_array Dim ErrorFlag, ErrorString, key, array_size, i Dim DBConn, time_entered, my_insert If sDescription = "Chat" Then sDSN = "DSN=bChatSiteProblems; UID=bChatSiteProblems; PWD=ju1iusSK; DATABASE=SITE_PROBLEMS" sDbTable = "CHAT_SITE_PROBLEMS" ElseIf sDescription = "Bulletin Board" Then sDSN = "DSN=bBBSiteProblems; UID=bBBSiteProblems; PWD=ju1iusSK; DATABASE=SITE_PROBLEMS" sDbTable = "BB_SITE_PROBLEMS" Else sDSN = "DSN=bSiteProblems; UID=bSiteProblems; PWD=ju1iusSK; DATABASE=SITE_PROBLEMS" sDbTable = "SITE_PROBLEMS" End If sBullet = "

  • " status = Request.Form("STATUS") ' Do not change this line !!!! Set assoc_array = CreateObject("Scripting.Dictionary") ' ********* Modify below as needed ********* firstname = Request.Form("FIRST_NAME") lastname = Request.Form("LAST_NAME") email = Request.Form("EMAIL") browser = Request.Form("BROWSER REQUIRED") http_user_agent = Request.Form("HTTP_USER_AGENT") os = Request.Form("OS REQUIRED") ram = Request.Form("RAM") site = Request.Form("SITE") description = Request.Form("DESCRIPTION REQUIRED") reproducible = Request.Form("REPRODUCIBLE") ' ********* Modify below as needed ********* ' NOTE: "assoc_array" needed for display of missed REQUIRED fields assoc_array.Add "BROWSER REQUIRED", "Browser/Version" assoc_array.Add "OS REQUIRED", "Operating System" assoc_array.Add "DESCRIPTION REQUIRED", "The " & sDescription & " Problem" If status <> "processform" Then ' Show the form ShowProblemForm(sDescription) Else ' Process the form ErrorFlag = FALSE array_size = 0 ErrorString = sJSK_Font1 & "The following required fields must be submitted.
    Please try again." & "
    " For Each key in Request.Form 'Cycle through values If InStr(key, "REQUIRED") Then If Trim(Request.Form(key)) = "" Then ErrorFlag = TRUE Redim Preserve missing_required_fields_array(array_size) missing_required_fields_array(array_size) = assoc_array(key) array_size = array_size + 1 End If End If Next If ErrorFlag Then Response.Write("" & vbcrlf & "" & vbcrlf) if array_size > 0 then For i = array_size - 1 to 0 Step -1 Response.Write("" & vbcrlf) Next End If Response.Write("
    " & ErrorString & "
    " & sJSK_Font1 & sBullet & missing_required_fields_array(i) & "" & "
    " & vbcrlf) ShowProblemForm(sDescription) Else ' Send the form and do SQL back end stuff On Error Resume Next Set DBConn = Server.CreateObject("ADODB.Connection") DBConn.Open sDSN time_entered = Now ' Replace ' with '' so SQL doesn't choke firstname = Replace(firstname, "'", "''") lastname = Replace(lastname, "'", "''") email = Replace(email, "'", "''") browser = Replace(browser, "'", "''") os = Replace(os, "'", "''") ram = Replace(ram, "'", "''") site = Replace(site, "'", "''") description = Replace(description, "'", "''") reproducible = Replace(reproducible, "'", "''") time_entered = Replace(time_entered, "'", "''") http_user_agent = Replace(http_user_agent, "'", "''") my_insert = "INSERT INTO " & sDbTable & " (First_Name, Last_Name, Email, Browser, OS, RAM, Site, Description, Reproducible, Time_Entered, Http_User_Agent) VALUES('" & firstname & "','" & lastname & "','" & email & "','" & browser & "','" & os & "','" & ram & "','" & site & "','" & description & "','" & reproducible & "','" & time_entered & "','" & http_user_agent & "')" DBConn.Execute(my_insert) If Err Then Response.Write(sJSK_Font1 & "

    Sorry, there was a problem with the database. Please try again later.

    Choose one of the links above to go to another part of About.com.

    " & "") Err.Clear Else Response.Write(sJSK_Font1 & "

    Thank you.
    Your information was successfully submitted." & "") End If DBConn.Close End If End If End Function %> <% Private Function ShowProblemForm(sDescription) %> <% ShowProblemForm = TRUE %> <% Dim bc %>

    <%' Do not change this line !!!! %> <% If sDescription <> "" Then %>
    <%= sJSK_Font1 %>Having a <%= sDescription %> problem? We want to know so we can make the About.com service better. Please complete the form below, and provide as much detail as you can. Fields are required except where marked 'optional'.
    <%= sJSK_Font1 %>Were you using this browser when the <%= sDescription %> problem occurred? " <% If http_user_agent = Request.ServerVariables("HTTP_USER_AGENT") OR status <> "processform" Then %><%= "CHECKED" %><% End If %>>
    <%= sJSK_Font1 %>Browser/Version: <% Set bc = Server.CreateObject("MSWC.BrowserType") %> <% If bc.Browser <> "Unknown" Then %><%= bc.Browser & " " & bc.Version %><% End If %><% Else %><%= browser %><% End If %>" SIZE="20" MAXLENGTH="50">
    <%= sJSK_Font1 %>Operating System:
    <%= sJSK_Font1 %>RAM (optional):
    <%= sJSK_Font1 %>Site (optional): <%= LCase( Request.ServerVariables("SERVER_NAME") ) %><% Else %><%=site%><% End If %>" SIZE="20" MAXLENGTH="50">
    <%= sJSK_Font1 %>The <%= sDescription %> Problem:
    Describe the problem - Be sure to enter a description of what you were doing when the problem occurred.
    <%= sJSK_Font1 %>Is the <%= sDescription %> problem reproducible? <%="CHECKED" %> <% End If %>><%= sJSK_Font1 %>Yes <%="CHECKED" %> <% End If %>><%= sJSK_Font1 %>No <%= "CHECKED" %> <% End If %>><%= sJSK_Font1 %>Don't Know
    <%= sJSK_Font1 %>Email (optional):
    <%= sJSK_Font1 %>First Name (optional):
    <%= sJSK_Font1 %>Last Name (optional):
    <% Else %>
    <% End If %>
    <% End Function %>
  • spacer
    shadow
    shadow

    Arts/Literature | Autos | Business/Careers | Computing/Technology | Education | Entertainment | Finance/Investing | Games | Health/Fitness | Hobbies | Home/Family | Internet/Online | Kids | Local | News/Media | Shopping | Society/Culture | Sports | Teens | Travel |
    About A-Z | About.com Home | Top of Page
    © 1999 About.com, Inc. All rights reserved.
    ©   1999 About.com, Inc. "MiningCo.com" and "About.com" are trademarks of About.com, Inc.,
    a publicly traded company listed on NASDAQ under the symbol "BOUT."
    For more information on About.com, visit Our Story, Be a Guide, Be an Advertiser, or Investor Relations.
    For rules of use, read our User Agreement; for privacy concerns, read our Privacy Policy.
    Having a Problem? Report it here.