I am having a problem that I can not figure out...
I have a ASP form page /Quiz.asp that processes the form itself. and then has a redirect to a Confirmation.asp page I am trying to figure out how to pass off the PK_ID from the new record being create in the database to the new confirmation page so that they can see some of their information and quiz answers.
Below is the code, please let me know if you have any questions to better answer my question
Quiz.asp
Expand|Select|Wrap|Line Numbers
- sql="INSERT INTO ITQA(FName, LName, Email) VALUES('" & _
- Request("firstname") & "', '" & Request("lastname") & _
- "', '" & Request("email") & _
- End Select
- cn.Execute sql
- Response.Clear
- Response.Redirect "IT_QandA_Confirm.asp?ID="& Request("ID")
- end if
- %>
- <BODY>
- <form action="Quiz.asp" method="post">
- <input type="hidden" name="ID" value=<%=Request("ID")%>>
- <table>
- <tr>
- <th>Name :</th>
- <td><input type="text" name="firstname" value="">
- <input type="text" name="lastname" value=""></nobr></td>
- </tr>
- <tr>
- <th >Email Address:</th>
- <td><input type="text" name="email" value=""></td>
Expand|Select|Wrap|Line Numbers
- <%
- 'Confirmation Form
- Response.Write "<HTML><Body>
- <P>Thank you for taking our little quiz...<P>" &_
- "Your entry will be put into our system and all of the top scores will be put into a drawing" &_
- "<b>Submitted By: </b>" + Request.Form("firstname") + " " + Request.Form("lastname") + "<br>" &_
- "<b>E-mail: </b>" + Request.Form("email") + "<BR>" &_
- "<a href=Quiz_Answers.asp?ID=" + Request.Form("PK_ID") + " >Check out your score here.</a></body></html>"
- %>