I am testing to see that the form variables got posted and if they didn't I want to send them back to the login page.

I have the redirect working with the following command:

header("Location: index.php5");

I would like a way to know on the home page that I have come back to it because the login failed so I could add a user message to display telling them they have to fill in the form completely (DUH!)

So I tired adding a variable called "$form_failed" to the code - but when it comes back to the home page it throws an error of:

Undefined variable: form_failed

Here is the code where I added the variable. 😕 Obviously I don't have a clue how to pass the value back to the other page and am doing this all wrong. Could someone put me on the right track?

if (!filled_out($_POST))
 {
  $form_failed = True;
  header("Location: index.php5");
  exit;
  }

Thanks!

    if (!filled_out($_POST)) 
    { 
      header('location: http://www.conjurer.com/index.php5?form_failed=1');
      exit();
    }
    

    then look for $_GET['form_failed'] in index.php5

      Write a Reply...