gaya Posted January 8, 2013 Share Posted January 8, 2013 Hi, Please any1 tell how to set the previous button. For eg if i'm writing an exam in online and i'm viewing the questions one by one. If i viewed the first question i'll press the next button to view the 2nd question.Bt if i again want to view the 1st question means i've to click the previous button. I dnt knw how to set the previous button. Please any one tell me how to do this. Link to comment Share on other sites More sharing options...
Mudsaf Posted January 8, 2013 Share Posted January 8, 2013 (edited) I guess you could use sessions atleast. Example if session doesnt exist if (!isset($_SESSION['currentquestion'])) {$_SESSION['currentquestion'] = 0;} And each next button press = session + 1 and store data with sessions also i guess. Also jQuery might do this, but im not quite sure how-to. (I guess jQuery would also be more user-friendly and better) Edited January 8, 2013 by Mudsaf 1 Link to comment Share on other sites More sharing options...
birbal Posted January 8, 2013 Share Posted January 8, 2013 Instead of using browser button for interactivity of your application you should use html markup to create the next previous button. you can append the question number or id in each next or previous link. each time a page is loaded you can manipulate next and previous button id/number from the current page and then you can print it dynamically. previous page will never be less than 1 and next link will not be greater than total questions or highest question id ("Depening upon implementation of your application) 1 Link to comment Share on other sites More sharing options...
gaya Posted January 10, 2013 Author Share Posted January 10, 2013 (edited) Thank you Mudsaf and birbal. Edited January 10, 2013 by gaya Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now