根据stackoverflow中给出的示例,我尝试了greybox popup,从我的php程序中基于if条件的函数调用。
它给出了如下错误: 解析错误:语法错误,第456行/home/public_html/atst/dc-detail-qty.php中的意外'='
if if条件为true的php部分代码,greybox popup应该有效:
if($dcecrbal < 0)
{
$pop=100;
echo "<span class='sty1'>Negative Bal: ".$dcecrbal." (Total ECR: ".$ecrdtl." - Total DCs: ".$dcdtl.") </span>";
//echo "<script>child_open();</script>";
echo "<script>";
pathArr = window.location.pathname.split('/');
path = window.location.protocol + "//" + window.location.host+"/";
for (i=1;i<pathArr.length-1;i++) path += pathArr[i]+"/";
GB_showCenter('ECR', path+'ecrframe-qty.php' , 800, 600);
echo "</script>";
}
答案 0 :(得分:0)
应该是这样的
echo "<script>
pathArr = window.location.pathname.split('/');
path = window.location.protocol + '//' + window.location.host+'/';
for (i=1;i<pathArr.length-1;i++) path += pathArr[i]+'/';
GB_showCenter('ECR', path+'ecrframe-qty.php' , 800, 600)";
echo "</script>";