ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old June 25th, 2003, 02:28 PM
aspnewbie aspnewbie is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: The Great White North
Posts: 361 aspnewbie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 50 sec
Reputation Power: 7
Send a message via MSN to aspnewbie
Forms - Passing Info From Page to Page

I have created an online quiz to add some interactivity to a site.

There are around 20 questions, so I think that I should probably divide the questions into two pages.

I don't need to record the results in a db. It's just for fun. However, I would like to be able to display the user's answers and the correct answers.

How do I get the data from page 1 to page 3 (the results page)? Should I store the info in a sessionid? Should I pass it in a querystring? I've read about sql injection attacks so I'm reluctant to pass querystrings, but then there are downsides to using sessions too!

Reply With Quote
  #2  
Old June 25th, 2003, 03:18 PM
iahmed iahmed is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2003
Location: USA
Posts: 171 iahmed User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 42 m 58 sec
Reputation Power: 6
Did you think to post them through hidden tags?
<input type=hidden ....

Reply With Quote
  #3  
Old June 25th, 2003, 04:06 PM
aspnewbie aspnewbie is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: The Great White North
Posts: 361 aspnewbie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 50 sec
Reputation Power: 7
Send a message via MSN to aspnewbie
perhaps you can help me out a bit more - I'm a little thick.

On page 1, I have

<input type='radio' name='" & CurrentQuestion & "' value='" & oRS("Answer") & "'>" & oRS("Answer")

and that submits to page 2

how do I get those same values to page 3, using hidden values?

Reply With Quote
  #4  
Old June 25th, 2003, 05:43 PM
iahmed iahmed is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2003
Location: USA
Posts: 171 iahmed User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 42 m 58 sec
Reputation Power: 6
On The first page:

<input type=hidden name="CurrQuestion" value="<%=Answer%>

On The 2nd page:

Answer = "" & Request.Form("CurrQuestion")



However, for a better understanding of passing values between web pages, read the tutorial from the link below:

http://www.learnasp.com/learn/hidden.asp

Reply With Quote
  #5  
Old June 25th, 2003, 06:31 PM
aspnewbie aspnewbie is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: The Great White North
Posts: 361 aspnewbie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 50 sec
Reputation Power: 7
Send a message via MSN to aspnewbie
thanks, the link you sent explains everything! Glad that I don't have to use session info or querystrings.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingASP Development > Forms - Passing Info From Page to Page


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT