User Name
Password

Go Back   Planetarion Forums > Non Planetarion Discussions > Programming and Discussion
Register FAQ Members List Calendar Arcade Today's Posts

Reply
Thread Tools Display Modes
Unread 8 Jul 2004, 23:22   #1
JammyJim
Godfather
 
JammyJim's Avatar
 
Join Date: May 2000
Location: England
Posts: 5,185
JammyJim has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.JammyJim has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.JammyJim has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.JammyJim has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.JammyJim has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.JammyJim has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.JammyJim has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.JammyJim has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.JammyJim has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.JammyJim has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.JammyJim has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
Asp

okies...


I have 8 pages of 'questions' which have 3 possible answers. You can click the answer by hitting one of the radio buttons.


Everything is written in ASP and HTML.

Now....

i wrote a simliar proggry before but it was a single page. If they hit 'submit' and the next page detected that they hadnt filled in all the boxes it sent it back using 'server.transfer("questions.asp")

i had a nice piece of code after every check box which basically did a 'request.form("q1") and checked to see if it equaled 1 2 3 4 or 5. depending on that value it would recheck the box?

hopefully your following

Basically its a page that remembers what youve put in and if you make an error then it will send you back but leave all the data you DID fill in intact.


this works absolutely aces with a single page

heres the dilemma

page 1 :

15 questions.
3 possible answers

page 2
15 questions
3 possible answers

page 3
15 questions
3 possible answers


page1 sends its information to page 2. Before page 2 writes the html it performs a series of checks.

1. is the page accessed illegally if so return to login
2. open the database and fetch the userid (each user is stored. its not open to the public)
3. Retrieve all the variables for current page (so if an error is detected on the next one it will be able to catch it with a 'request.form("q1page1") command jobby
4. start working with the previous pages variables.
(this includes checking to make sure they are all greater than zip. If they arnt then it will server.transfer back to the previous page.

if everything is hunkey dorey it moves on and stores all the answers in the database. This all happens instantly of course (or near as damnit)

it then shows the page.

process repeats when they hit submit to the next page.

SO the page looks something along these lines :


'THIS PAGE IF AN ERROR IS DETECTED
b1 = Request.Form("b1")
b2 = Request.Form("b2")
b3 = Request.Form("b3")
b4 = Request.Form("b4")
b5 = Request.Form("b5")



'LAST PAGES DATA...

a1 = Request.Form("a1")
a2 = Request.Form("a2")
a3 = Request.Form("a3")
a4 = Request.Form("a4")
a5 = Request.Form("a5")
a6 = Request.Form("a6")
a7 = Request.Form("a7")


so the b's are page 2
the a's are page 1 ready for 'processing'

bs are only used when an error is detected and its sent back


however if you have 3 pages and when checking the third page it detects an error it transfers the data back but it doesnt have the data for page 2. So when it does a check to see if B = something and it doesnt it then server transfers AGAIN back another page.

see the problem?
__________________
Forum Administrator
Mail : [email protected] // IRC : #forums
__________________
It's not personal, it's just business.
JammyJim is offline   Reply With Quote
Unread 8 Jul 2004, 23:26   #2
JammyJim
Godfather
 
JammyJim's Avatar
 
Join Date: May 2000
Location: England
Posts: 5,185
JammyJim has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.JammyJim has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.JammyJim has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.JammyJim has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.JammyJim has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.JammyJim has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.JammyJim has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.JammyJim has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.JammyJim has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.JammyJim has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.JammyJim has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
Re: Asp

just to add something.

page 4 = no data just a thankyou. still processes
Page 3 = C
page 2 = B
page 1 = A


if page 4 detects an error with page 3 it sends it back to page 3. page 3 contains code looking for page 2 variable names. if theyre not dected it sends it back to page 2. (repeat until you end up on the original page)
__________________
Forum Administrator
Mail : [email protected] // IRC : #forums
__________________
It's not personal, it's just business.
JammyJim is offline   Reply With Quote
Unread 8 Jul 2004, 23:28   #3
Quazi Starbucks
Heh
 
Join Date: Nov 2003
Location: Winchester
Posts: 527
Quazi Starbucks is an unknown quantity at this point
Re: Asp

c1 = Request.Form("c1")
c2 = Request.Form("c2")
c3 = Request.Form("c3")
c4 = Request.Form("c4")
c5 = Request.Form("c5")
c6 = Request.Form("c6")
c7 = Request.Form("c7")

questions on page 1 are stored in a
questions in page 2 stored in b
questions in page 3 stored in c

you get the idea? theoretically all the data should be sent back

but its a lot easier if you store the answers given in the database
Quazi Starbucks is offline   Reply With Quote
Unread 9 Jul 2004, 01:25   #4
Intrepid00
Registered User
 
Join Date: Aug 2000
Posts: 1,967
Intrepid00 is an unknown quantity at this point
Re: Asp

This is why I love ASP.NET and its Viewstate.
Intrepid00 is offline   Reply With Quote
Unread 9 Jul 2004, 15:11   #5
JetLinus
Friendly geek of GD :-/
 
JetLinus's Avatar
 
Join Date: Nov 2000
Location: On my metal roid
Posts: 923
JetLinus has much to be proud ofJetLinus has much to be proud ofJetLinus has much to be proud ofJetLinus has much to be proud ofJetLinus has much to be proud ofJetLinus has much to be proud ofJetLinus has much to be proud ofJetLinus has much to be proud ofJetLinus has much to be proud ofJetLinus has much to be proud of
Arrow Re: Asp

Maybe I didn't understand, but, workarounds:

Store data in database after every page. If you need them, just load them from db (at page creation time).
Hmmm... Doesn't really fit in your conecpt, huh?


So, ok, why not do the <input type="hidden"> trick?
Page 1, datacheck, generates page 2, with hidden answers of page 1 in it.
Page 2, checks NEW answers, will transfer data from pages 1 and 2 on to page 3. K?
__________________
[»] Entropy increases! :-/
JetLinus is offline   Reply With Quote
Unread 9 Jul 2004, 18:32   #6
Raging.Retard
Street Tramp
 
Raging.Retard's Avatar
 
Join Date: Apr 2000
Location: Street Gutter
Posts: 341
Raging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant future
Re: Asp

Just dump all the vars in the session object. Thats what its there for.
__________________
Chimney Pots.
Raging.Retard is offline   Reply With Quote
Unread 9 Jul 2004, 22:05   #7
Sundipper
Hourly Fee : $450
 
Sundipper's Avatar
 
Join Date: Oct 2000
Posts: 15
Sundipper is an unknown quantity at this point
Re: Asp

here is something similar using JS .. Use radio buttons if you like, the modifications are minimal.

Try this html file you'll like it!

My first ideea was to use some array session variables, but I'm not the first saying that. It's easy, they can be overwritten or unset when they're not needed .. no duplicates .. etc.

TBH, to store something in the DB after each page is kind'a stupid, because you'll get problems with duplicates at each page refresh (if the dudes are using that button for various reasons) and you have to avoid that writting some supplementary code and using indexes ..
__________________
SunDipping; A Way of Living.

Last edited by Sundipper; 9 Jul 2004 at 22:17.
Sundipper is offline   Reply With Quote
Unread 13 Jul 2004, 12:49   #8
hinchles
Registered User
 
Join Date: Aug 2003
Posts: 55
hinchles is an unknown quantity at this point
Re: Asp

*cough* sessions *cough*
__________________
www.furious-angels.com
Furious Angels Founder
hinchles is offline   Reply With Quote
Unread 13 Jul 2004, 12:52   #9
sayonara
Shai Halud
 
sayonara's Avatar
 
Join Date: Aug 2001
Location: Sunny Leeds \o/
Posts: 2,127
sayonara is just really nicesayonara is just really nicesayonara is just really nicesayonara is just really nicesayonara is just really nice
Re: Asp

Quote:
Originally Posted by hinchles
*cough* oh for the love of sweet baby jesus *cough* sessions *cough*
__________________
meow
sayonara is offline   Reply With Quote
Reply



Forum Jump


All times are GMT +1. The time now is 04:02.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2002 - 2018