Re: Reload page after form submit

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

 





brian wrote:
Instruct ICC wrote:
From your rough code, I'd say the OP always needs the select block (just remove the "else" keyword and keep the block) for the current info at the present page refresh/load. But I'd like clarification on how the OP thinks about it.


That's close, i think. But the select isn't necessary if the user has submitted a post because, either way, $first & $last will be set to the latest values.

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.

-afan

--
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