...

View Full Version : sending variables to another contact form



eiger23
01-16-2012, 04:57 PM
Trying to send some variables over to another contact form page, but it's not working out for me and I have to finish this by noon today :(.

The first form is 3 questions, then when you submit, it will take you to a contact form where you can complete the registration process. Problem is that its not putting in the variables from the previous page when the final form is submitted. Not sure what I'm doing wrong.

Here is the code for part 1 of the form on the first page:


<form name="sending" method="POST" action="contact-us.asp" target="_self">

<table border=0 z id="form" style="padding:0px;">
<tr>
<td align="right">
Area of Practice
</td>
<td align="left">
<table class="area_ofpractice" cellpadding="0" cellspacing="0">
<tr>
<td>
<select name="occupation">

<option></option>
<option>Allergy & Immunology </option><option>Anesthesiology </option><option>Bariatric Surgery </option><option>Cardiology</option><option>Cosmetic Surgeon </option><option>Dermatology </option><option>Emergency Medicine </option><option>Endocrinology, Diabetes, & Metabolism </option><option>Family Practice </option><option>Gastroenterology </option><option>General Practice </option><option>Geriatrics</option>
<option>Gynecology </option><option>Hematology </option><option>Infectious Disease </option><option>Internal Medicine </option><option>Nephrology </option><option>Neurological Surgery </option><option>Neurology </option><option>Obstetrics/Gynecology </option><option>Oncology </option><option>Ophthalmology</option><option>Orthopedic Surgery </option><option>Otolaryngology </option>
<option>Pain Management </option><option>Pathology </option><option>Pediatrics </option><option>Physical Medicine & Rehabilitation </option><option>Plastic Surgery </option><option>Preventive Medicine </option><option>Psychiatry</option><option>Pulmonary Surgery </option><option>Pulmonology (without surgery) </option><option>Radiology Urology</option><option>Rheumatology </option><option>Vascular Surgery</option>
</select>
</td>

</tr>
</table>
</td>
</tr>

<tr>
<td align="right">
State of Practice
</td>
<td align="left">
<table class="state_ofpractice" cellpadding="0" cellspacing="0">
<tr>
<td>
<select name="drop_down2">
<option></option><option>Arizona</option><option>Arkansas</option><option>California</option><option>Connecticut</option><option>Delaware</option><option>Florida</option><option>Georgia</option><option>Illinois</option><option>Indiana</option><option>Kentucky</option><option>Maryland</option><option>Massachusetts</option><option>Michigan</option>Missouri</option><option>Montana</option><option>New Jersey</option><option>New York</option><option>North Carolina</option><option>Ohio</option><option>Oklahoma</option><option>Pennsylvania</option><option>South Carolina</option><option>Tennessee</option><option>Texas</option><option>Virginia</option><option>Washington</option><option>West Virginia</option>
</select>
</td>
</tr>
</table>
</td>
</tr>

<tr>
<td align="right">
Are you Insured?
</td>
<td align="left">
<table class="are_youinsured" cellpadding="0" cellspacing="0">
<tr>
<td>

<select name="drop_down3">
<option></option><option>Yes, I do carry malpractice insurance</option><option>No, I do not carry malpractice insurance. </option><option>I'm thinking about going bare</option>
</select>
</td>
</tr>
</table>
</td>
</tr>



<tr>
<td></td>
<td style="padding:2px;">

<input type="submit" button value="Sign Up Now" name="submit">

</td>
</tr>
</table>
</form>


then here is the code on the page that should be receiving those variables and then sending them out at the end:



<% @LANGUAGE = "VBScript" %>
<%
' ===================================================
' Receives Form and uses SENDMAIL to email the result
' to an email address
'====================================================
Dim StrTitle,StrMethod,StrUrl,result
Dim StrBodyHtml,oMail,StrEmail,strFrom,strReply,strSubject,FormSubmitted

'strMethod=Ucase(Request.ServerVariables("Request_Method"))
'strTitle=Ucase(Request.ServerVariables("Server_Name")) & "InfoRequest"
'strUrl=Lcase(Request.ServerVariables("URL"))
' with Response End With doesn't work with the development server

if Request("FormSubmitted") Then

'==================================CAPTCHA ====================================
Function CheckCAPTCHA(valCAPTCHA)
SessionCAPTCHA = Trim(Session("CAPTCHA"))
Session("CAPTCHA") = vbNullString
if Len(SessionCAPTCHA) < 1 then
CheckCAPTCHA = False
exit function
end if
if CStr(SessionCAPTCHA) = CStr(valCAPTCHA) then
CheckCAPTCHA = True
else
CheckCAPTCHA = False
end if
End Function

if Request.ServerVariables("REQUEST_METHOD") = "POST" then
strCAPTCHA = Trim(Request.Form("strCAPTCHA"))

if CheckCAPTCHA(strCAPTCHA) = true then
StrBodyHtml= " Urgent! - Following message was received Via website " & "<br>"
StrBodyHtml=StrBodyHtml & " --------------------------------------------------------- " & "<br><br><br>"
StrBodyHtml=StrBodyHtml & "<b>Name: </b>" & Request("txtFirst") & "<br>"
StrBodyHtml=StrBodyHtml & "<b>Property Address: </b>" & Request("txtAddress") & "<br>"
StrBodyHtml=StrBodyHtml & "<b>City St, Zip: </b>" & Request("txtCity") & ", " & Request("txtSt") & " " & Request("txtZip") & "<br>"
StrBodyHtml=StrBodyHtml & "<b>Email Address: </b>" & Request("txtEmail") & "<br>"
StrBodyHtml=StrBodyHtml & "<b>Phone: </b>" & Request("txtTel1") & "<br>"
StrBodyHtml=StrBodyHtml & "<b>Alternate Phone: </b>" & Request("txtTel2") & "<br>"
StrBodyHtml=StrBodyHtml & "<b>Message: </b>" & Request("txtMsg") & "<br><br>"
StrBodyHtml=StrBodyHtml & "<b>Occupation: </b>" & Request.form ("occupation") & "<br><br>"

'General Information =========================
strEmail = Request("txtemail")
strFrom = Request("txtEmail")
strReply = Request("txtEmail")
strSubject = "Lubell Rosen Website - On-Line Information Request Part 2"
Set oMail = Server.CreateObject("CDONTS.Newmail")
oMail.To = "je@jonathaneiger.com"
'oMail.To = "kavizad@yahoo.com"
oMail.From = strFrom
'oMail.Value("Reply-To") = strReply
oMail.BodyFormat = 0
oMail.MailFormat = 0
oMail.Subject = strSubject
oMail.Body = strBodyHTML
result = oMail.Send
Set oMail = Nothing
'response.redirect("./InfoReqThanks.htm")
%>


this is the form for that page:



<form action="contact-us.asp" method="post" name="frmInfo" id="frmInfo" onsubmit="return checkEmail(txtEmail.value)">
<input type="hidden" name="formSubmitted" value="True" />
<table width="100%" border="0" class="bodytextbig">
<tr align="left" valign="top">
<td colspan="2" height="41"><font color="#000000">You may also complete
the following form and we will contact you. <font color="b3013c"><strong>(*
Required Fields)</strong></font><br />
Your personal information cannot be sold or given
to any other party.</font></td>
</tr>
<tr>
<td width="25%"><font color="#000000">Name:</font><font color="b3013c"><strong>*</strong></font></td>
<td width="75%"> <input class="frm" type="text" name="txtFirst" maxlength="20" />
</td>
</tr>
<tr>
<td width="25%"><font color="#000000">Address:</font></td>
<td width="75%"> <input class="frm" type="text" name="txtAddress" size="30" maxlength="35" />
</td>
</tr>
<tr>
<td width="25%"><font color="#000000">City:</font></td>
<td width="75%"> <input class="frm" type="text" name="txtCity" maxlength="25" />
</td>
</tr>
<tr>
<td width="25%"><font color="#000000">State:</font></td>
<td width="75%"> <input class="frm" type="text" name="txtSt" size="2" maxlength="2" />
</td>
</tr>
<tr>
<td width="25%"><font color="#000000">Zip Code:</font></td>
<td width="75%"> <input class="frm" type="text" id="Zip" name="txtZip" size="5" maxlength="5" />
</td>
</tr>
<tr>
<td width="25%"><font color="#000000">E-Mail:</font><font color="b3013c"><strong>*</strong></font></td>
<td width="75%"> <input class="frm" type="text" id="Email" name="txtEmail" size="40" maxlength="45" />
</td>
</tr>
<tr>
<td width="25%"><font color="#000000">Confirm E-Mail:</font><font color="b3013c"><strong>*</strong></font></td>
<td width="75%"> <input class="frm" type="text" id="Email" name="txtEmail2" size="40" maxlength="45" />
</td>
</tr>
<tr>
<td width="25%"><font color="#000000">Phone:</font><font color="b3013c"><strong>*</strong></font></td>
<td width="75%"> <input class="frm" type="text" id="DayPhone" name="txtTel1" size="14" maxlength="20" />
</td>
</tr>
<tr>
<td width="25%"><nobr><font color="#000000">Alternate Phone:</font></nobr></td>
<td width="75%"> <input class="frm" type="text" id="EvePhone" name="txtTel2" size="14" maxlength="20" />
</td>
</tr>
<tr>
<td valign="top" width="25%"><font color="#000000">Comments:</font><font color="b3013c"><strong>*</strong></font></td>
<td align="left" width="75%"> <textarea class="frm" rows="5" cols="42" id="Comments" name="txtMsg"></textarea>
<br /> </td>
</tr>
<tr>
<td align="left" valign="top"><font color="#000000">Please Enter Code:</font></td>
<td align="left"><img src="aspcaptcha.asp" alt="Enter Code Below" width="86" height="21" /><br />
<input name="strCAPTCHA" value="" size="12" />
</td>
</tr>
<tr>
<td align="left" valign="top">&nbsp;</td>
<td align="left"><input class="frm" type="submit" value="Submit" name="submit" /></td>

<input type="hidden" name="occupation" />

</tr>
</table>
</form>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum