Re: nested if's
- From: cwdjrxyz <spamtrap2@xxxxxxxxxx>
- Date: Tue, 13 May 2008 15:43:34 -0700 (PDT)
On May 13, 2:24 pm, JRough <jlro...@xxxxxxxxx> wrote:
I got lost on formatting the nested if/else's on the bottom of the
file right up the last else/if there seems to be a stray bracket. I'm
trying to line up the brackets so I can read it. Is it okay to split
a long line setting a variable on two lines at the equals sign? That
is so you can read it in google groups.
<?
//Send payement advices
$TPL_auction_id = $auction_id;
$user_id=$userrec["id"];
if(!$sessionVars["SELL_action"]) {
include "header.php";}
if($FEE>0) {
if($SETTINGS["invoicing"] == 'y') {
if(!$sessionVars["SELL_action"]=="edit") {
include phpa_include("template_menu_php.html");
include phpa_include("template_sell_result_php.html");
} else {
$auction_url =
$SETTINGS["siteurl"] . "item.php?mode=1&id=".$auction_id;
if($sessionVars["SELL_action"]=="edit") {
unset($_SESSION["sessionVars"]);
unset($_SESSION["RELISTEDAUCTION"]);
if(isset($_SESSION['backtolist']))
header("Location: ".$_SESSION['backtolist']."?PAGE=
".$_SESSION['backtolist_page']);
else
header("Location: yourauctions.php?PAGE=
".$_SESSION['backtolist_page']);
exit;
}
if($sessionVars["SELL_action"]=="reopen") {
unset($_SESSION["sessionVars"]);
unset($_SESSION["RELISTEDAUCTION"]);
header("Location: yourauctions_c.php?PAGE=
".$_SESSION['backtolist_page']);
exit;
}}
} elseif($SETTINGS["feetype"] == "prepay") {
if(!$sessionVars["SELL_action"]) {
//include "header.php";}
include "lib/auctionsetup_payment.php";} else {
if($sessionVars["SELL_action"]) {
include "header.php";
include phpa_include("template_menu_php.html");}
?>
The first thing I think of when something with this much logic comes
up is a switch statement. Of course sometimes it is not suited at all
or only for some of the logic. However, when you can use switch, the
code is much more orderly and easy to modify. You may have already
considered switch and found problems in using it, so excuse me for
bringing up the subject if that is the case. I do not have time just
now to consider the details of your code and test them. The php switch
is nearly the same as a Javascript switch in the formal code structure.
.
- Follow-Ups:
- Re: nested if's
- From: C. (http://symcbean.blogspot.com/)
- Re: nested if's
- References:
- nested if's
- From: JRough
- nested if's
- Prev by Date: Discount, Chanel LV Sunglasses, Coach Dior Sandals, Boss COOGI T-shirts, NFL NBA jersey, etc
- Next by Date: Re: nested if's
- Previous by thread: Re: nested if's
- Next by thread: Re: nested if's
- Index(es):
Relevant Pages
|