doubai9014 2016-10-21 09:49
浏览 60

解析错误:语法错误,意外T_ECHO,期待','或';' 在第40行的/web/htdocs/www.bp-electronics.com/home/bpgest2/sheets/ddt.php [重复]

This question already has an answer here:

Good morning, I have watched many times the code below and I could not understand where is the error. previously the error was on line 38 and was able to correct it, but now I just can not. Please help me.

thanks in advance

<?php
     if(!$getQ[1]){
       if(@$_GET['undo']){mysql_query("UPDATE ddt SET ddtundo=1 WHERE  id='".$_GET['undo']."'");}
?>
<br><br>
<table border="0" cellspacing="1" cellpadding="4" width="99%" align="center">

 <tr>
   <td align="center" width="22"></td>
   <td align="left" class="txt_lit_grey" width="180"><b>Data</b></td>
   <td align="left" class="txt_lit_grey"><b>Cliente</b></td>
   <td align="left" class="txt_lit_grey"><b>Decoder</b></td>
   <td align="left" class="txt_lit_grey" width="90"><b>N. articoli</b></td>
   <td align="center" width="22"></td>
   <td align="center" width="22"></td>
   <td align="center" width="22"></td>
   <td align="center" width="22"></td>
 </tr>

 <?php
     $row=0;
     $qu=mysql_query("SELECT * FROM users");
     while($ru=mysql_fetch_assoc($qu)){$users[$ru['id']]=$ru['fullname'];}

     $q=mysql_query("SELECT * FROM ddt ORDER BY data DESC");
     while($r=mysql_fetch_assoc($q)){
          $tot=count(explode("|",$r['ware']));
          $items=explode("|",$r['ware']); 
          for($i=0;$i<count($items);$i++){
             if($i%2){$fill=1;}else{$fill=0;}
             $value=explode("#",$items[$i]); 
             $qc=mysql_query("SELECT * FROM catalog WHERE id='".$value[0]."'");
             $rc=mysql_fetch_assoc($qc); 
           }
           if($row%2){$bgcolor="#ffffff";}else{$bgcolor="#eeeeee";}

           echo "<tr>n";
           if($r['ddtundo']){echo "<td bgcolor="#dddddd" height="5" align="center" class="txt_lit_white radius"> </td>n";}else{echo "<td bgcolor="#dddddd" height="5" align="center" class="txt_lit_white radius"> </td>n";}

           echo "<td bgcolor="$bgcolor" height="5" align="left" class="txt_lit_black">".date("d/m/Y H:i.s",strtotime($r['data']))."</td>n";
           echo "<td bgcolor="$bgcolor" height="5" align="left" class="txt_lit_black">".$r['operator']."</td>n";
           echo "<td bgcolor="$bgcolor" height="5" align="left" class="txt_lit_black">".$rc['short_description']."</td>n";
           echo "<td bgcolor="$bgcolor" height="5" align="left" class="txt_lit_black">".$tot."</td>n";

           echo "<td bgcolor="$bgcolor" align="center"><a class="cb_iframe" href="sheets/ddt/pdf_ddt.php?id=".$r['id']."" title="Visualizza"><img src="img/icons/view.png"></a></td>n";
           echo "<td bgcolor="$bgcolor" align="center"><a class="cb_iframe" href="sheets/ddt/modify.php?id=".$r['id']."" title="Modifica"><img src="img/icons/modify.png"></a></td>n"; 
           echo "<td bgcolor="$bgcolor" align="center"><a class="cb_iframe" href="sheets/ddt/delete.php?id=".$r['id']."" title="Elimina"><img src="img/icons/download.png"></a></td>n"; 

           echo "</tr>n";
           $row++;
      }    
 ?>
</table>
<table border="0" cellspacing="4" cellpadding="4" width="99%">
     <tr>
        <td valign="top" align="right">
           <a href"sheets/ddt/new_ddt.php"><input type="button" class="button_blu button_big" value="<?php if($_SESSION['DDT']['DATA']){echo "Apri DDT in sospeso";}else{echo "Nuovo DDT";}?>">
           </a>
        </td>
     </tr>
</table>
<?php

    }else{@include 'sheets/ddt/new_ddt.php';}
?>
</div>
  • 写回答

1条回答 默认 最新

  • duange2971 2016-10-21 09:55
    关注

    You're using quotation marks or "" in the wrong way.

    When echoing text you have to escape evertyhing that's inside that might be confliting with the quotation marks used to delimitate your text, in that case:

    echo "<td bgcolor="$bgcolor" height="5" align="left" class="txt_lit_black">".date("d/m/Y H:i.s",strtotime($r['data']))."</td>n";
    

    would become

    echo "<td bgcolor=\"$bgcolor\" height=\"5\" align=\"left\" class=\"txt_lit_black\">".date("d/m/Y H:i.s",strtotime($r['data']))."</td>n";
    
    评论

报告相同问题?

悬赏问题

  • ¥15 在获取boss直聘的聊天的时候只能获取到前40条聊天数据
  • ¥20 关于URL获取的参数,无法执行二选一查询
  • ¥15 液位控制,当液位超过高限时常开触点59闭合,直到液位低于低限时,断开
  • ¥15 marlin编译错误,如何解决?
  • ¥15 有偿四位数,节约算法和扫描算法
  • ¥15 VUE项目怎么运行,系统打不开
  • ¥50 pointpillars等目标检测算法怎么融合注意力机制
  • ¥20 Vs code Mac系统 PHP Debug调试环境配置
  • ¥60 大一项目课,微信小程序
  • ¥15 求视频摘要youtube和ovp数据集