I just got to the end of an assignment I needed to do and its due tommorow, but I broke my code and i've just spent hours trying to fix it, but I can't. Here are the two things I have left to complete....
1. A student must access and complete section 1 before proceeding to any other section. (For instance if a student types in the URL for section 2 they will automatically be redirected back to section 1 if they have not completed it)
2. All input for each section must be validated before the student can continue to the next section. If any data is not valid then the section must be redisplayed with HTML form controls loaded with previously entered data, along with appropriate error messages
Now it was actually doing the second one, remebering all the information, say if you pushed next and hadn't filled out all the required fields, it would redirect you back to the previous page and remember everything you'd previously put in. Then I started trying to do the first one and I broke the code and now my mind is blanked out, ive spent day and night trying to get this finished (hard for a first time PHPer) so can anyone help me please ?? :) Now when you havn't filled out the required fields it doesnt matter what page your on, it takes you back to page 1 and forgets everything. When you press the back button in the brower (ie), it used to have a pop up that said you need to re-send the information, but it isnt doing that anymore :( For the life of me I can't see where i've gone wrong.
So I need help getting the second one going, you'll see ive got an if statement at the top of the pages that used to work and do what it is supposed to, but now it doesnt. Also once its doing the second one, could someone please tell me how I get the first problem going. How the tutor is going to test that is when he's anywhere and hasnt filled out the first actual survey page (survey2.php) and manually changes to the url to say survey4.php(or any other page after 2, it should re-direct him back to survey2.php. I orginally thought of another if statement at the top of survey3.php survey4.php survey5.php survey6.php, checking the session variables for survey page 2 and if they were empty send the user back to survey2.php.
If anyone could help me the code i'd appreciate it so much. Sorry for the novel guys, but im nearly finished :) I'll post all my pages here and if anyone needs anymore info like my mysql scripts or anything, just ask. Oh by the way my code is really really ugly, its my first time, I started learning 2 weeks. I know I should of separated the HTML and php, but I didnt know how and didnt have time to learn. K thats it for me, thankyou to anyone who even got this far reading.