|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Redirection based on query result...?
I have a quiz that writes the results to an Access db. When the user logs in, I want it to redirect them based on their score.
I want them to login and get directed to page 2. Page 2 queries the db based on the user/pass. If the quizcompleted=0, they get directed to the quiz. If the quizcompleted=1, they get directed to a page that says "You've taken the quiz and your score was _________ ." The problem is that I am new and my PHP knowledge isn't helping me do this in ASP. Any help on how to do this would be greatly appreciated. |
|
#2
|
|||
|
|||
|
put the following code into your page 2, after the login has been validated.
Code:
<%
If validlogon Then
Select Case rsResults("quizcompleted")
Case 0
Response.Redirect (address of quiz here)
Case 1
Response.Redirect (address of quiz completed page)
Case Else
'no other result
End Select
else
Response.Redirect (invalid logon on page)
end if
%>
You would need to either pass the quiz result as a parameter in the redirect (i.e. page.htm?QuizScore=<users score>) or re-query the database at the other page. You could also use If....then....else statements, it's up to you.
__________________
How can I soar like an eagle when I'm flying with turkey's? Last edited by mohecan : May 19th, 2003 at 10:12 PM. |
|
#3
|
|||
|
|||
|
Edit:
Ok I got the conditional statements there and the info posted appropriately, but I ran into another problem. I'm going to post the new problem seperately since it's completely different. Thanks again! Last edited by Foundation : May 21st, 2003 at 04:33 PM. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Redirection based on query result...? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|