form processing question
Posted: Fri Jun 17, 2005 10:29 am
Hey everyone I just started working with PhP a few days ago and its been a while since I actualy got to do any real coding in my worklife so I'm a little rusty and was wondering if anyone could help me out. I'm currently working on a quizzing application using PhP to pull the questions ands answers from a database that I already have setup.
I made a system DNS connection to the database and I am using PhPs ODBC functions to access it. what I'm having it do is look at the marker in the question that determines if its a multiple choice question or single answer question and dynamically make a form with the question and answers in radio button format for single answer and checkbox format for multiple answer. All of this is working fine so far save one thing. I need it to print out one question and one set of answers then wait for the user to hit the submit button before going into and printing the next question.
That way if the question has a wrong answer I can bring up a new browser window giving them the answer and referance pages to look at and then print out the next question and series of answers. I thought about using an if statment something similar to the following.
where "i" would be a generic counter and rowcount the total count of rows pulled from the SQL query. proceed would initally be set to 1 to enter the if statement the first time then set to 0 inside and would only go back to 1 if submit was pressed. This way I can guarantte it runs at least once.The issue is I think this would "only" execute once then drop out and a do while loop dosent look like it would work either because theres no way of stopping it. is there any kind of and I hate to even say this "goto" statement in PhP that I can use to just move my marker back up to a previous code line as a source of flow control?
I made a system DNS connection to the database and I am using PhPs ODBC functions to access it. what I'm having it do is look at the marker in the question that determines if its a multiple choice question or single answer question and dynamically make a form with the question and answers in radio button format for single answer and checkbox format for multiple answer. All of this is working fine so far save one thing. I need it to print out one question and one set of answers then wait for the user to hit the submit button before going into and printing the next question.
That way if the question has a wrong answer I can bring up a new browser window giving them the answer and referance pages to look at and then print out the next question and series of answers. I thought about using an if statment something similar to the following.
Code: Select all
if($i < $rowcount and $proceed = 1)