nested if's



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");
}
?>

thanks,
.



Relevant Pages

  • Re: nested ifs
    ... file right up the last else/if there seems to be a stray bracket. ... then see what the others have in common. ... Switches are fine if you have multiple branching on a single test. ...
    (comp.lang.php)
  • Re: nested ifs
    ... file right up the last else/if there seems to be a stray bracket. ... php is a not a card-image language like Forran. ... isolate the repetative calls with variables and 'actions'...which are what is in common. ...
    (comp.lang.php)
  • Re: nested ifs
    ... file right up the last else/if there seems to be a stray bracket. ... php is a not a card-image language like Forran. ... repetative calls with variables and 'actions'...which are what is in common. ...
    (comp.lang.php)
  • Re: nested ifs
    ... JRough wrote: ... file right up the last else/if there seems to be a stray bracket. ... sentence language where each sentence ends in a semicolon. ...
    (comp.lang.php)