FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » button, parameter and reload - How do I glue it all together?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: button, parameter and reload - How do I glue it all together? [message #178802 is a reply to message #178801] Mon, 06 August 2012 16:59 Go to previous message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma:
Senior Member
On Mon, 06 Aug 2012 05:47:44 -0700, mwoolley wrote:

> if (isset($_POST['fbb']) or isset($_POST['fbb_x'])) {
> build the backwards
> } else {
> if (isset($_POST['fbf']) or isset($_POST['fbf_x'])) {
> build the forwards
> }
> }

Suggestion:

if ( forwards_condition ) {
do the forwards thing
}
elseif ( backwards_condition ) {
do the backwards thing
}
else {
do the nothing thing
}

You don't need to use an if inside the else, elseif (or else if) allows
you to split a decision more than two ways without nesting if statements,
and in this case would be more logical.

Rgds

Denis McMahon
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: App2Fame is back: Bigger, Better & Loads of Prizes.
Next Topic: Handling with xmlhttp.responseText
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 10:27:10 GMT 2024

Total time taken to generate the page: 0.05148 seconds