Return query on the same page

3

I need to query the Bank and return the value of the variables on the same page PHP . But even the test to try to understand logic did not work:

<html>
<form name="registar" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">

sua form bLA BLA BLA

<input type="submit" class="submit" name="submit"  value="Enviar registo" />
</form>

<?
if (!$_POST['submit']) {

echo "bla bla bla SEU nome, pass";

} else {

echo "AGUARDANDO";

}
?>

</html>

In this case it only enters the "WAITING FOR".

Can anyone give me an idea?

    
asked by anonymous 25.05.2015 / 20:05

1 answer

4

Change the condition of your if to something like this:

<html>

    <form name="registar" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
        <input type="hidden" name="oculto" value="teste">
        <input type="submit" class="submit" name="submit"  value="Enviar registo" />
    </form>

    <?php
    if (isset($_POST['submit'])) {
        var_dump($_POST);
    } else {
        echo "AGUARDANDO";
    }
    ?>

</html>

The isset() checks to see if $_POST['submit'] exists in the way it is always going to the false condition.

    
25.05.2015 / 20:18