Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 超过允许值时,打开一个单独的窗口_Php - Fatal编程技术网

Php 超过允许值时,打开一个单独的窗口

Php 超过允许值时,打开一个单独的窗口,php,Php,当我尝试执行上述任务时,出现语法错误。发生了什么?有什么指导吗? 这个想法是,在这种情况下,当列数超过9时,由于空间限制,将显示一个按钮,单击该按钮,一个单独的窗口将显示更多细节。separte窗口在这里不是问题。请看这里: <?php $actionCount = count($this->actionpoints); $maxCols = 9; $actualCols = ($actionCount &

当我尝试执行上述任务时,出现语法错误。发生了什么?有什么指导吗? 这个想法是,在这种情况下,当列数超过9时,由于空间限制,将显示一个按钮,单击该按钮,一个单独的窗口将显示更多细节。separte窗口在这里不是问题。请看这里:

  <?php 
            $actionCount = count($this->actionpoints);
            $maxCols = 9;
            $actualCols = ($actionCount > $maxCols) ? $maxCols + 1 : $actionCount;

            if($this->permission_number<=9 && $this>view_permission['action_points'] ){
            $actualCols = ($actionCount > $maxCols) ? $maxCols + 1 : $actionCount;
            }else {$('#button').show();
              <input type="submit" value="show details"></input>;
            }             
            //followed by more codings...
   ?>

语法错误从else行开始。请提前征求您的意见

应该是:

}else {
?>
  <input type="submit" value="show details" onclick="widow.open('new_url')"></input>;
<?php
}  
}其他{
?>
;

我认为正确的代码是

<?php 
        $actionCount = count($this->actionpoints);
        $maxCols = 9;
        $actualCols = ($actionCount > $maxCols) ? $maxCols + 1 : $actionCount;

        if($this->permission_number<=9 && $this->view_permission['action_points'] ){
        $actualCols = ($actionCount > $maxCols) ? $maxCols + 1 : $actionCount;
        }else { ?>
        <script>    
            $('#button').show();
        </script>   
          <input type="submit" value="show details"></input>;
        <?php }             
        //followed by more codings...
?>

$(“#按钮”).show();
;

您将HTML/JavaScript输出与服务器端PHP脚本混合,这通常是一件坏事,并且会导致这样的错误。请考虑使用模板或至少指定的视图文件,谢谢您的建议: