Do not use on any
shared computer
August 21, 2008 08:56pm pdt
 
[x]
Attachment Details

Frontpage 2003 DRW - Send form results to database and email

Tags: frontpage, form, email, database, 2003
I created a form in Frontpage 2003 using DRW.  The form results are written to a database, but I also need them to be sent to multiple email addresses.  (I read through the Microsoft whitepaper re CDONTS, but as I'm not a programmer, I couldn't understand most of it.)

The form code is below.  Sorry it's so long -- I didn't know what to include to provide the most detail.
Thank you.

FORM CODE:
<%
' FP_ASP ASP Automatically generated by a Frontpage Component. Do not Edit.

On Error Resume Next
Session("FP_OldCodePage") = Session.CodePage
Session("FP_OldLCID") = Session.LCID
Session.CodePage = 1252
Session.LCID = 1033
Err.Clear

strErrorUrl = ""

If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
If Request.Form("VTI-GROUP") = "0" Then
      Err.Clear

      Set fp_conn =  Server.CreateObject("ADODB.Connection")
      FP_DumpError strErrorUrl, "Cannot create connection"

      Set fp_rs = Server.CreateObject("ADODB.Recordset")
      FP_DumpError strErrorUrl, "Cannot create record set"

      fp_conn.Open Application("grandrounds_ConnectionString")
      FP_DumpError strErrorUrl, "Cannot open database"

      fp_rs.Open "tblUsers", fp_conn, 1, 3, 2 ' adOpenKeySet, adLockOptimistic, adCmdTable
      FP_DumpError strErrorUrl, "Cannot open record set"

      fp_rs.AddNew
      FP_DumpError strErrorUrl, "Cannot add new record set to the database"
      Dim arFormFields0(14)
      Dim arFormDBFields0(14)
      Dim arFormValues0(14)

      arFormFields0(0) = "username"
      arFormDBFields0(0) = "UID"
      arFormValues0(0) = Request("username")
      arFormFields0(1) = "specialty"
      arFormDBFields0(1) = "specialty"
      arFormValues0(1) = Request("specialty")
      arFormFields0(2) = "street"
      arFormDBFields0(2) = "street"
      arFormValues0(2) = Request("street")
      arFormFields0(3) = "firstname"
      arFormDBFields0(3) = "firstname"
      arFormValues0(3) = Request("firstname")
      arFormFields0(4) = "fax"
      arFormDBFields0(4) = "fax"
      arFormValues0(4) = Request("fax")
      arFormFields0(5) = "email"
      arFormDBFields0(5) = "email"
      arFormValues0(5) = Request("email")
      arFormFields0(6) = "lastname"
      arFormDBFields0(6) = "lastname"
      arFormValues0(6) = Request("lastname")
      arFormFields0(7) = "phone"
      arFormDBFields0(7) = "phone"
      arFormValues0(7) = Request("phone")
      arFormFields0(8) = "zip"
      arFormDBFields0(8) = "zip"
      arFormValues0(8) = Request("zip")
      arFormFields0(9) = "other"
      arFormDBFields0(9) = "other"
      arFormValues0(9) = Request("other")
      arFormFields0(10) = "city"
      arFormDBFields0(10) = "city"
      arFormValues0(10) = Request("city")
      arFormFields0(11) = "password"
      arFormDBFields0(11) = "PWD"
      arFormValues0(11) = Request("password")
      arFormFields0(12) = "state"
      arFormDBFields0(12) = "state"
      arFormValues0(12) = Request("state")
      arFormFields0(13) = "physician"
      arFormDBFields0(13) = "physician"
      arFormValues0(13) = Request("physician")

      FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0

      FP_SaveFieldToDB fp_rs, Now, "timestamp"

      fp_rs.Update
      FP_DumpError strErrorUrl, "Cannot update the database"

      fp_rs.Close
      fp_conn.Close

      Session("FP_SavedFields")=arFormFields0
      Session("FP_SavedValues")=arFormValues0
      Session.CodePage = Session("FP_OldCodePage")
      Session.LCID = Session("FP_OldLCID")
      Response.Redirect "../../grandrounds/register_ty.asp"

End If
End If

Session.CodePage = Session("FP_OldCodePage")
Session.LCID = Session("FP_OldLCID")

%>
<html>

<head>

<%
Session("Username") = Request.Form("UserName")
Session("Password") = Request.Form("Password")
%>

<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Grand Rounds Registration</title>
</head>

<body>

<form method="POST" action="--WEBBOT-SELF--" name="grandrounds">
      <!--webbot bot="SaveDatabase" startspan SuggestedExt="asp" S-DataConnection="grandrounds" S-RecordSource="tblUsers" U-Database-URL="../../_private/grandrounds.mdb" U-Confirmation-Url="../../grandrounds/register_ty.asp" S-Builtin-Fields="Timestamp" S-Builtin-DBFields="timestamp" S-Form-Fields="username specialty street firstname fax email lastname phone zip other city password state physician" S-Form-DBFields="UID specialty street firstname fax email lastname phone zip other city PWD state physician" U-ASP-Include-Url="../../_fpclass/fpdbform.inc" --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--#include file="../../_fpclass/fpdbform.inc"--><!--webbot bot="SaveDatabase" endspan i-checksum="43152" -->
      <table border="0" width="100%" cellspacing="0" cellpadding="0" id="table1">
            <tr>
                  <td valign="top" width="252" align="right"><b><font face="Verdana" size="2">First Name:</font></b></td>
                  <td valign="top" width="20" align="right">&nbsp;</td>
                  <td width="621" colspan="7" valign="top"><font size="1" face="Verdana"><input type="text" name="firstname" size="20"></font></td>
            </tr>
            <tr>
                  <td valign="top" width="252" align="right"><b><font face="Verdana" size="2">Last Name:</font></b></td>
                  <td valign="top" width="20" align="right">&nbsp;</td>
                  <td width="621" colspan="7" valign="top"><font size="1" face="Verdana"><input type="text" name="lastname" size="20"></font></td>
            </tr>
            <tr>
                  <td valign="top" width="252" align="right"><b><font face="Verdana" size="2">Username:</font></b></td>
                  <td valign="top" width="20" align="right">&nbsp;</td>
                  <td width="621" colspan="7" valign="top"><font size="1" face="Verdana"><input type="text" name="username" size="20"></font></td>
            </tr>
            <tr>
                  <td valign="top" width="252" align="right"><b><font face="Verdana" size="2">Password:</font></b></td>
                  <td valign="top" width="20" align="right">&nbsp;</td>
                  <td width="621" colspan="7" valign="top">
                  <font size="1" face="Verdana">
                  <input type="password" name="password" size="20"></font></td>
            </tr>
            <tr>
                  <td valign="top" width="252" align="right"><b><font face="Verdana" size="2">Street Address:</font></b></td>
                  <td valign="top" width="20" align="right">&nbsp;</td>
                  <td width="621" colspan="7" valign="top"><font size="1" face="Verdana"><input type="text" name="street" size="20"></font></td>
            </tr>
            <tr>
                  <td valign="top" width="252" align="right"><b><font face="Verdana" size="2">City:</font></b></td>
                  <td valign="top" width="20" align="right">&nbsp;</td>
                  <td width="125" valign="top"><font size="1" face="Verdana"><input type="text" name="city" size="20"></font></td>
                  <td width="124" align="right" valign="top">
                  <font face="Verdana" size="2"><b>State:</b>&nbsp; </font> </td>
                  <td width="124" valign="top" colspan="2"><font size="1" face="Verdana"><select name="state" id="state">
                                                <option value=invalid>Choose State...</option>
                                                <option value="AL">Alabama</option><option value="AK">
                                                Alaska</option><option value="AZ">Arizona</option>
                                                <option value="AR">Arkansas</option><option value="CA">
                                                California</option><option value="CO">Colorado</option>
                                                <option value="CT">Connecticut</option><option value="DE">
                                                Delaware</option><option value="DC">District of
                                                Columbia</option>
                                                <option value="FL">Florida</option><option value="GA">
                                                Georgia</option><option value="HI">Hawaii</option>
                                                <option value="ID">Idaho</option><option value="IL">
                                                Illinois</option><option value="IN">Indiana</option>
                                                <option value="IA">Iowa</option><option value="KS">
                                                Kansas</option><option value="KY">Kentucky</option>
                                                <option value="LA">Louisiana</option><option value="ME">
                                                Maine</option><option value="MD">Maryland</option>
                                                <option value="MA">Massachusetts</option><option value="MI">
                                                Michigan</option><option value="MN">Minnesota</option>
                                                <option value="MS">Mississippi</option><option value="MO">
                                                Missouri</option><option value="MT">Montana</option>
                                                <option value="NE">Nebraska</option><option value="NV">
                                                Nevada</option><option value="NH">New Hampshire</option>
                                                <option value="NJ">New Jersey</option><option value="NM">
                                                New Mexico</option><option value="NY">New York</option>
                                                <option value="NC">North Carolina</option><option value="ND">
                                                North Dakota</option><option value="OH">Ohio</option>
                                                <option value="OK">Oklahoma</option><option value="OR">
                                                Oregon</option><option value="PA">Pennsylvania</option>
                                                <option value="RI">Rhode Island</option><option value="SC">
                                                South Carolina</option><option value="SD">South
                                                Dakota</option>
                                                <option value="TN">Tennessee</option><option value="TX">
                                                Texas</option><option value="UT">Utah</option>
                                                <option value="VT">Vermont</option><option value="VA">
                                                Virginia</option><option value="WA">Washington</option>
                                                <option value="WV">West Virginia</option><option value="WI">
                                                Wisconsin</option><option value="WY">Wyoming</option>
                    </select></font></td>
                  <td width="124" align="right" valign="top" colspan="2">
                  <font face="Verdana" size="2"><b>Zip:</b>&nbsp; </font> </td>
                  <td width="124" valign="top">
                  <font size="1" face="Verdana">
                  <input type="text" name="zip" size="10"></font></td>
            </tr>
            <tr>
                  <td valign="top" width="252" align="right"><b><font face="Verdana" size="2">Email:</font></b></td>
                  <td valign="top" width="20" align="right">&nbsp;</td>
                  <td width="621" colspan="7" valign="top"><font size="1" face="Verdana"><input type="text" name="email" size="20"></font></td>
            </tr>
            <tr>
                  <td valign="top" width="252" align="right"><b><font face="Verdana" size="2">Phone:</font></b></td>
                  <td valign="top" width="20" align="right">&nbsp;</td>
                  <td width="621" colspan="7" valign="top">
                  <font size="1" face="Verdana">
                  <input type="text" name="phone" size="20"></font></td>
            </tr>
            <tr>
                  <td valign="top" width="252" align="right"><b><font face="Verdana" size="2">Fax:</font></b></td>
                  <td valign="top" width="20" align="right">&nbsp;</td>
                  <td width="621" colspan="7" valign="top"><font size="1" face="Verdana"><input type="text" name="fax" size="20"></font></td>
            </tr>
            <tr>
                  <td valign="top" width="252" align="right"><b><font face="Verdana" size="2">Are you a physician?</font></b></td>
                  <td valign="top" width="20" align="right">&nbsp;</td>
                  <td width="621" colspan="7" valign="top">
                  <font size="1" face="Verdana">
                  <input type="radio" value="Yes"   name="physician"></font><font face="Verdana" size="2">Yes&nbsp;
                  </font><font size="1" face="Verdana">
                  <input type="radio" name="physician" value="No"><font face="Verdana" size="2">No</td>
            </tr>
            <tr>
                  <td valign="top" width="252">&nbsp;</td>
                  <td valign="top" width="20">&nbsp;</td>
                  <td width="621" colspan="7" valign="top">
                  &nbsp;</td>
            </tr>
            <tr>
                  <td valign="top" width="252">
                  <p align="right"><font face="Verdana" size="2"><b>Specialty:</b>
                  </p></font>
                  <font color="#FF0000" size="1" face="Verdana"><i>*To select multiple specialties, hold the
                  ctrl button while clicking on your selections.</i></font></td>
                  <td valign="top" width="20">&nbsp;</td>
                  <td colspan="3" valign="top">
                  <select name="specialty" multiple size="10">
                                    <option value="Acute_Inpatient_Rehab__Service">Acute
                                    Inpatient Rehabilitation Service</option>
                                    <option value="Anesthesiology">Anesthesiology</option>
                                    <option value="Audiology">Audiology</option>
                                    <option value="Cardiology">Cardiology</option>
                                    <option value="Cardiothoracic_Surgery">Cardiothoracic
                                    Surgery</option>
                                    <option value="Center_for_Motion_Analysis">Center for
                                    Motion Analysis</option>
                                    <option value="Craniofacial">Craniofacial Team</option>
                                    <option value="Critical_Care">Critical Care</option>
                                    <option value="Dentistry">Dentistry</option>
                                    <option value="Developmental_Peds">Developmental &amp;
                                    Behavioral Pediatrics</option>
                                    <option value="Education_Rehab_Services">Education &amp;
                                    Rehabilitation Services</option>
                                    <option value="Emergency_Medicine">Emergency Medicine</option>
                                    <option value="Endocrinology">Endocrinology</option>
                                    <option value="Gastroenterology">Gastroenterology</option>
                                    <option value="Gynecology">Gynecology</option>
                                    <option value="Hand_Surgery">Hand Surgery</option>
                                    <option value="Hearing">Hearing</option>
                                    <option value="Hematology_Oncology">Hematology /
                                    Oncology</option>
                                    <option value="Human_Genetics">Human Genetics</option>
                                    <option value="Infectious_Disease">Infectious Disease</option>
                                    <option value="Inpatient_Services">Inpatient Services</option>
                                    <option value="Neonatology">Neonatology</option>
                                    <option value="Nephrology">Nephrology</option>
                                    <option value="Neurology">Neurology</option>
                                    <option value="Neurosurgery">Neurosurgery</option>
                                    <option value="Nutrition">Nutrition</option>
                                    <option value="Occupational_Therapy">Occupational
                                    Therapy Care Center</option>
                                    <option value="Ophthalmology">Ophthalmology</option>
                                    <option value="Oral_Maxillofacial_Surgery">Oral &amp;
                                    Maxillofacial Surgery</option>
                                    <option value="Orthopaedics">Orthopaedics</option>
                                    <option value="ENT">Otolaryngology, Head-Neck Surgery
                                    (ENT)</option>
                                    <option value="Physical_Therapy">Physical Therapy Care
                                    Center</option>
                                    <option value="Plastic_Surgery">Plastic Surgery</option>
                                    <option value="Primary_Care">Primary Care Center</option>
                                    <option value="Psychiatry">Psychiatry</option>
                                    <option value="Pulmonary">Pulmonary Medicine</option>
                                    <option value="Radiology">Radiology</option>
                                    <option value="Rehabilitation">Rehabilitation Services</option>
                                    <option value="Rheumatology">Rheumatology</option>
                                    <option value="Residency_Program">The Residency Program</option>
                                    <option value="Speech">Speech &amp; Language Pathology</option>
                                    <option value="Sports Medicine">Sports Medicine</option>
                                    <option value="Surgery">Surgery</option>
                                    <option value="Urology">Urology</option>
                                    </select></font></font></td>
                  <td colspan="2" valign="top">
                  <b>
                  <font face="Verdana" size="2">Other:</font></b></td>
                  <td width="155" colspan="2" valign="top">
                  <input type="text" name="other" size="20"></td>
            </tr>
      </table>
      <p><font size="1" face="Verdana"><input type="submit" value="Submit" name="submit"><input type="reset" value="Reset" name="B2"></font></p>
</form>

<%
If Session("Ori_URL") = "" Then
Else
Response.redirect(session("Ori_URL"))
End If
%>

</body>

</html>
Start your free trial to view this solution
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Question Stats
Zone: Web Development
Question Asked By: kimberlys777
Solution Provided By: jasons73
Participating Experts: 3
Solution Grade: A
Views: 56
Translate:
Loading Advertisement...
 
[+][-]Expert Comment by jasons73
Expert Comment by jasons73:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by kimberlys777
Author Comment by kimberlys777:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by Merete
Expert Comment by Merete:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by kimberlys777
Author Comment by kimberlys777:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by Merete
Expert Comment by Merete:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by jasons73
Expert Comment by jasons73:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by jasons73
Expert Comment by jasons73:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by kimberlys777
Author Comment by kimberlys777:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by jasons73
Expert Comment by jasons73:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by kimberlys777
Author Comment by kimberlys777:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by bigbillydotcom

Rank: Master

Expert Comment by bigbillydotcom:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by kimberlys777
Author Comment by kimberlys777:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by jasons73
Expert Comment by jasons73:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by jasons73
Expert Comment by jasons73:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by jasons73
Expert Comment by jasons73:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by kimberlys777
Author Comment by kimberlys777:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by jasons73
Expert Comment by jasons73:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by kimberlys777
Author Comment by kimberlys777:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by jasons73
Expert Comment by jasons73:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by kimberlys777
Author Comment by kimberlys777:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by