Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #6730

Re: button, parameter and reload - How do I glue it all together?

From Denis McMahon <denismfmcmahon@gmail.com>
Newsgroups comp.lang.php
Subject Re: button, parameter and reload - How do I glue it all together?
Date 2012-08-06 16:59 +0000
Organization A noiseless patient Spider
Message-ID <jvot5m$3j8$1@dont-email.me> (permalink)
References <ec8466e1-7d98-4750-bc1a-c1c11e0d7c2a@googlegroups.com> <4f960174-4043-459d-8626-e4ef6884d781@googlegroups.com>

Show all headers | View raw


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

Back to comp.lang.php | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

button, parameter and reload - How do I glue it all together? mwoolley <trogoz2012@gmail.com> - 2012-08-03 07:29 -0700
  Re: button, parameter and reload - How do I glue it all together? The Natural Philosopher <tnp@invalid.invalid> - 2012-08-03 16:23 +0100
    Re: button, parameter and reload - How do I glue it all together? Jerry Stuckle <jstucklex@attglobal.net> - 2012-08-03 11:35 -0400
  Re: button, parameter and reload - How do I glue it all together? Jerry Stuckle <jstucklex@attglobal.net> - 2012-08-03 11:50 -0400
  Re: button, parameter and reload - How do I glue it all together? Michael Vilain <vilain@NOspamcop.net> - 2012-08-03 23:00 -0700
  Re: button, parameter and reload - How do I glue it all together? mwoolley <trogoz2012@gmail.com> - 2012-08-06 05:47 -0700
    Re: button, parameter and reload - How do I glue it all together? Denis McMahon <denismfmcmahon@gmail.com> - 2012-08-06 16:59 +0000

csiph-web