如果是嵌套的 [英] nested if's

查看:83
本文介绍了如果是嵌套的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我迷失了格式化

文件底部的嵌套if / else',直到最后一个/如果似乎有一个迷路支架。我是

试图排列括号,以便我可以阅读它。

是否可以在等号的两行上设置变量?那个

是这样你可以在google群组中阅读它。


< ;?

//发送付款通知

$ TPL_auction_id = $ auction_id;

$ user_id = $ userrec [" id"];

if(!$ sessionVars [" SELL_action"] ){

包括header.php;

}

if($ FEE> 0){

if($ SETTINGS [" invoicing"] ==''y''){

if(!$ sessionVars [" SELL_action"] ==" edit"){

包括phpa_include(" template_menu_php.html");

包括phpa_include(" template_sell_result_php.html");

}其他{

$ auction_url =

$ SETTINGS [" siteurl"]。 " item.php?mode = 1& id ="。$ auction_id;

if($ sessionVars [" SELL_action"] ==" edit"){

unset($ _ SESSION [" sessionVars"]);

unset($ _ SESSION [" RELISTEDAUCTION&qu​​ot;]);

if(isset($ _ SESSION [' 'backtolist'']))

header(" Location:"。$ _ SESSION [''backtolist'']。"?PAGE =

"。 $ _SESSION [''backtolist_page'']);

else

header(" Location:yourauctions.php?PAGE =

" 。$ _ SESSION [''backtolist_page'']);

退出;

}

if($ sessionVars [" SELL_action"] = =" reopen"){

unset($ _ SESSION [" sessionVars"]);

unset($ _ SESSION [" RELISTEDAUCTION&qu​​ot;]);

header(" Location:yourauctions_c.php?PAGE =

"。$ _ SESSION [''backtolist_page'']);

退出;

}

}

} elseif($ SETTINGS [" feetype"] == 预付款){

if(!$ sessionVars [" SELL_action"]){

// include" header.php";

}

包括lib / auctionsetup_payment.php;

}否则{

if($ sessionVars [" SELL_action" ]){

包括header.php;

包括phpa_include(" template_menu_php.html");

}

?>


谢谢,

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,

推荐答案

TPL_auction_id =
TPL_auction_id =


auction_id;
auction_id;


user_id =
user_id=


这篇关于如果是嵌套的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆