Re: Reload page after form submit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Afan Pasalic wrote:

brian wrote:

The problem that i see is here:

if (isset($_POST))

This will always return TRUE. It should rather be:

if (isset($_POST['name_of_your_submit_btn']))

or some other form element, at least.

I don't know if this was simply because it was a rough draft of the code or even if it's the cause of the problem (which i still don't quite understand) but, anyway ...

brian

nope. ONLY when form with method POST is submitted. if you open the page first time "else" block will be executed. though, I agree it's much better to have if(isset($_POST['SubmitForm']) and $_POST['SubmitForm'] == 'Submit')
where <input type=Submit name=SubmitForm value="Submit">
but, as I said earlier, it's not the code, just an idea.


<?php
if (isset($_POST))
{
    print('What did i tell you?');
}
?>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux