duanchi8112 2016-05-23 08:46
浏览 23
已采纳

PHP / HTML行导致页面空白[关闭]

I really have no idea how to fix this. Everytime I add this line of code to my php document, the page goes blank. Has anyone encountered this issue before?

It's in a table. Apparently it's the checked_id[] array. Don't know how to fix it, it just causes the page to go blank when added.

<td align="center"><input type="checkbox" name='.checked_id[];.' class="checkbox" value='.$row["id"].'</td>

Here's the whole block.

 $output .= '  
<form name="bulk_action_form" action="delete_multiple.php" method="post" onSubmit="return delete_confirm();"/>
      <div class="table-responsive">  
           <table class="table table-bordered">  
                <tr>  

                     <th width="10%">Id</th>  
                     <th width="40%">Name</th>  
                     <th width="40%">Email</th>  
                     <th width="40%">Address</th>  
                     <th width="10%">phoneNumber</th>  
                     <th width="10%">appointmentTime</th> 
                     <th width="10%">appointmentDate</th> 
                     <th width="50%">message</th> 
                     <th width="10%">delete</th>
                     <th><input type="checkbox" name="select_all" id="select_all" value=""/></th>
                </tr>';  



                             if(mysqli_num_rows($result) > 0)  
                             {  
                                  while($row = mysqli_fetch_array($result))  
                                  {  
                                       $output .= '  




                <tr>  

                     <td>'.$row["id"].'</td>
                     <td class="name" data-id1="'.$row["id"].'" contenteditable>'.$row["name"].'</td>  
                     <td class="email" data-id2="'.$row["id"].'" contenteditable>'.$row["email"].'</td>
                     <td class="address" data-id2="'.$row["id"].'" contenteditable>'.$row["address"].'</td>  
                     <td class="phoneNumber" data-id2="'.$row["id"].'" contenteditable>'.$row["phoneNumber"].'</td>  
                     <td class="appointmentTime" data-id2="'.$row["id"].'" contenteditable>'.$row["appointmentTime"].'</td>  
                     <td class="appointmentDate" data-id2="'.$row["id"].'" contenteditable>'.$row["appointmentDate"].'</td>
                     <td class="message" data-id2="'.$row["id"].'" contenteditable>'.$row["message"].'</td>
                     <td><button type="button" name="delete_btn" data-id3="'.$row["id"].'" class="btn btn-xs btn-danger                             btn_delete">Delete</button></td>
                     <td><input type="checkbox" name="'.checked_id[].'" class="checkbox" value="'.$row["id"].'"/></td>
                </tr>  
           ';  
      }                                   

 }  
 else  
 {  

      $output .= '<tr><td colspan="4">Data not Found</td></tr>';  
 }  


 $output .= '</table>  
      </div></form>';  
 echo $output;  
 ?>  
  • 写回答

2条回答 默认 最新

  • dongmi5020 2016-05-23 08:47
    关注

    Not properly structured:

    1. Missing close tag
    2. Missing quotes

    Use like this:

    <input type="checkbox" name="'.checked_id[].'" class="checkbox" value="'.$row["id"].'"/></td>
                                ^            ^ ^ ^                        ^              ^^^
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 做个有关计算的小程序
  • ¥15 MPI读取tif文件无法正常给各进程分配路径
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下
  • ¥15 setInterval 页面闪烁,怎么解决
  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动
  • ¥20 对于工程问题的非线性数学模型进行线性化