Domanda

As per the example given in stackoverflow I tried greybox popup, calling from a function based on a if condition in my php program.

It gives an error like: Parse error: syntax error, unexpected '=' in /home/public_html/atst/dc-detail-qty.php on line 456

The php partial code with if condition true, the greybox popup should work:

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>";
}
È stato utile?

Soluzione

That should be like this

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>";
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top