Hi, i have been working on some code, to do this, but i just cant get it...

i need it to do (in english) this:

First check if post vars have been submitted
                  |
            ______|______________________
           |                             |
 if they havent,        if they have go into process mode and check each  
display a form var against functions i have IF ______________|___________________ | | there are errors they get it right first put the error in errror_array go BUT still keeep checking, and display | the form again UNTIL redirect to unconfirm | ed.php they get the valus right and then it header(Location unconformed.php);

(Edited above chart to what I think you wanted and put it inside of "code" tags - NogDog)

I have used a lot of if statements, and it worked, but if they made an error it was impossible to get it right and go to next page.

i need sort of one statement that checks the var, and if true, keeps going, but if false executes some code BUT STILL keeps going, then checks at the end for any errors, and if none then redirects...

Thanks in advance

... i hope the flowchart comes out right

    Hi

    can you post some of your php script code
    to make it even more clear

    just copy and paste
    and put it inside php tags:

    [php]
    code
    [/php]

    -

      This is one way of doing it

      <?php
      
      $error = 0; // set $error to zero to start 
      
      // check through the POST values
      
      //if it doesn't equal what you want it to 
      //then add one to the error count
      if ($_POST['a']!='something'){
      	$error++;
      }
      
      if ($_POST['b']!='something_else'){
      	$error++;
      }
      
      if ($_POST['c']!='something_else_again'){
      	$error++;
      }
      
      
      if ($error===0){
      	//do what you need to do if all are correct
      } else {
      	// do what you have to do if there are errors
      }
      ?>

      But as your flow chart didn't come out as you expected, I could be barking up the wrong tree.

        Write a Reply...