Hello:
I am STUCK. I have a form that I need to perform a certain function based on your login information. Here's the info.
INSTRUCTION:
When the member logs in with their member id and password I first validate to make sure they are registered (THAT PART WORKS), then if they are a registered member I need to see if they already completed the form (if yes) display their contact information that's stored in the database then I also need to check if they applied for the position they clicked on (
if yes) then I want to allow them to update that record.
-or-
If the member already completed the form display their contact information then check if they applied for that paticular position (
if no) then I want to add a new record for each position they are applying for.
NOTE: The member contact information can be in the database once with multiple positions they're applying for. IF THIS MAKES ANY SENSE!!
Here's my form code:
<%@LANGUAGE="VBSCRIPT"%>
<!-- METADATA TYPE="typelib"
FILE="C:\Program Files\Common Files\System\ado\msado15.dll" -->
<%Option Explicit%>
<title>Member Application</title>
<script type="text/javascript" src="_script/hideFields.
js"></script>
<div id="content_region" class="div_content_region">
<table border="0" width="600" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2" valign="center" bgcolor="#006699"><img src="../gr/px.gif" width="1" height="15" alt="" border="0" />
<a href="../default.asp" class="crumb">NAEYC Home</a> > <a href="./" class="crumb">Get Involved</a> > Consulting Editors Panel
</TD>
</TR>
<TR>
<TD COLSPAN="2" VALIGN="TOP">
<TABLE BORDER="0" CELLSPACING="2"><TR><TD>
<h2> Consulting Editors for Young Children and NAEYC Publications Membership Application</h2>
<%
dim theMessage, SW, SQL, SQL1, SQL2, dob, conn, rsmem, pwd, esw, member_id, rslog, password
TheMessage=""
SW=0
If not isEmpty(Request.Form("login")) AND Request.Form("member_id") <> "" AND isNumeric(Request.Form("member_id")) then
password = Request.Form("password")
member_id = Request.Form("member_id")
if not isEmpty(Request.Form("member_id")) then
set conn=server.CreateObject ("adodb.connection")
conn.open Application("WebConnectionString")
SQL1="Select * from applicant where member_id=" & Request.Form("member_id") & " and password='" & Request.Form("password") & "'"
set rsmem=conn.Execute(SQL1)
'if rsmem.EOF then
' response.redirect "register.asp?e=1&mem=" & Request.Form("member_id")
'end if
if not rsmem.EOF then
pwd=rsmem("password")
sw=1
esw=1
if rsmem("date_of_birth")="1/1/1900" then
dob=""
else
dob=rsmem("date_of_birth")
end if
else
set conn=server.CreateObject ("adodb.connection")
conn.open = Application("ConnectionString")
sql2="Select * from logins where userid='" & Request.Form("member_id") & "'" & " and password='" & Request.Form("password") & "'"
'Response.Write sql2
Set rslog = conn.Execute(sql2)
if not rslog.EOF then
pwd=rslog("password")
'set conn=server.CreateObject ("adodb.connection")
'conn.open = Application("ConnectionString")
sql="Select * from member where member_id=" & Request.Form("member_id") & " and expiration_date >= getdate()"
'Response.Write sql
Set rsmem = conn.Execute(sql)
if rsmem.EOF then
TheMessage="We can not validate your membership, please enter valid member id."
else
sw=1
end if
else
Response.Redirect "../registerCouncil.asp?e=1&mem=" & Request.Form("member_id")
end if
end if
end if
end if
%>
<p align="left"></p>
<form method="POST" enctype="multipart/form-data" action="insert2.asp">
<input type="hidden" name="DateSubmit" value="<%=Date%>">
<input type="hidden" name="id" value="<%= member_id %>">
<input type="hidden" name="type" value="<%= Request.Form("direction") %>" ID="Hidden1">
<input type="hidden" name="passwd" value="<%= pwd %>" ID="Hidden79">
<input type="hidden" name="AppType" value="Consulting" />
<p> </p>
<table width="95%" border="1" align="center" cellpadding="0" cellspacing="4">
<tr>
<td></td>
<td width="67%"> </td>
</tr>
<tr>
<td width="33%" bgcolor="#E0DFE3"><strong>First Name: </strong></td>
<td><input name="AppFName" type="text" id="AppFName" size="50"></td>
</tr>
<tr>
<td bgcolor="#E0DFE3"><strong>Last Name: </strong></td>
<td><input name="AppLName" type="text" id="AppLName" size="50"></td>
</tr>
<tr>
<td bgcolor="#E0DFE3"><strong>Address 1: </strong></td>
<td><input name="AppAdd1" type="text" id="AppAdd1" size="50"></td>
</tr>
<tr>
<td bgcolor="#E0DFE3"><strong>Address 2:<span class="style2"> <br>
(Apt., Ste. #)</span> </strong></td>
<td><input name="AppAdd2" type="text" id="AppAdd2" size="50"></td>
</tr>
<tr>
<td bgcolor="#E0DFE3"><strong>City:</strong></td>
<td><input name="AppCity" type="text" id="AppCity" size="50"></td>
</tr>
<tr>
<td bgcolor="#E0DFE3"><strong>State:</strong></td>
<td><input name="AppState" type="text" id="AppState" size="2" maxlength="2"></td>
</tr>
<tr>
<td bgcolor="#E0DFE3"><strong>Zip Code: </strong></td>
<td><input name="AppZip" type="text" id="AppZip" size="10" maxlength="10"></td>
</tr>
<tr>
<td bgcolor="#E0DFE3"><strong>Home Phone: </strong></td>
<td><input name="AppHomePh" type="text" id="AppHomePh" size="50"></td>
</tr>
<tr>
<td bgcolor="#E0DFE3"><strong>Cell Phone: </strong></td>
<td><input name="AppCellPh" type="text" id="AppCellPh" size="50"></td>
</tr>
<tr>
<td bgcolor="#E0DFE3"><strong>Work Phone: </strong></td>
<td><input name="AppWorkPh" type="text" id="AppWorkPh" size="50"></td>
</tr>
<tr>
<td bgcolor="#E0DFE3"><strong>Email:</strong></td>
<td><input name="AppEmail" type="text" id="AppEmail" size="50"></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2">
<p><em>Please limit answers to no more than <strong>250 words</strong> per question.</em></p></td>
</tr>
<div id="council" style="display: 'none';">
<tr>
<td valign="top" bgcolor="#E0DFE3"><p><strong>Question 1: </strong></p> </td>
<td valign="top">What aspects of <em>Young Children</em> and the NAEYC books program are of most interest to you?</td>
</tr>
<tr>
<td> </td>
<td><textarea name="AppQ1" cols="60" rows="5" id="AppQ1"></textarea></td>
</tr>
<tr>
<td valign="top" bgcolor="#E0DFE3"><strong>Question 2: </strong></td>
<td valign="top">Does your schedule permit dedicating an average of 4 to 6 hours per month to reviewing tasks? What times of the year are you not available? </td>
</tr>
<tr>
<td> </td>
<td><textarea name="AppQ2" cols="60" rows="5" id="AppQ2"></textarea></td>
</tr>
<tr>
<td valign="top" bgcolor="#E0DFE3"><strong>Question 3: </strong></td>
<td valign="top">What are your views on how NAEYC can meet the diverse needs of our wide range of members in our publications?</td>
</tr>
<tr>
<td> </td>
<td><textarea name="AppQ3" cols="60" rows="5" id="AppQ3"></textarea></td>
</tr>
<tr>
<td valign="top" bgcolor="#E0DFE3"><strong>Question 4: </strong></td>
<td valign="top"> How do your interests and experience in the field match the goals of <em>Young Children</em> and the NAEYC books program? </td>
</tr>
<tr>
<td> </td>
<td><textarea name="AppQ4" cols="60" rows="5" id="AppQ4"></textarea></td>
</tr>
<tr>
<td valign="top" bgcolor="#E0DFE3"><strong>Question 5: </strong></td>
<td valign="top">The early childhood field is characterized by a wide range of relevant topics and work settings. Reviewers might bring to this panel interests and experience with specific content areas, age groups, and care and education settings. They might conduct research, serve as teacher educators, work directly with young children, or contribute to the field in other ways. Within this range, where do your strengths and interests lie? What kinds of articles and books do you think you will be best suited to review? </td>
</tr>
<tr>
<td> </td>
<td><textarea name="AppQ5" cols="60" rows="5" id="AppQ5"></textarea></td>
</tr>
<tr>
<td bgcolor="#E0DFE3"><strong>Resume Upload: </strong></td>
<td><input name="file" type="file" id="file" size="50"></td>
</tr>
</div>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="2"><h6>* One of the NAEYC Governing Board priorities is that “NAEYC, as a high performing, inclusive organization will develop diverse leadership to meet the needs of the early childhood field.” The NAEYC Governing Board and Staff believe that the mission is best achieved when there is commitment to diversity and inclusion as core values and when there are actions reflecting those values.</h6></td>
</tr>
<tr>
<td> </td>
<td>
<div align="center">
<input type="submit" name="Submit" value="Submit">
</div></td>
</tr>
</table>
</form>
</TD></TR></TABLE>
</div>
THANKS SO MUCH - I NEED TO FIGURE THIS OUT ASAP
webXtreme