How to placed php code inside escaped tables?

Discussion in 'PHP' started by co.ador, Jul 20, 2009.

  1. #1
    I am trying to insert this bit of php code

     <?php
          $ratingData = Rating::OutputRating($platename);
          
          if (Error::HasErrors())
          {
            echo Error::ShowErrorMessages();
            Error::ClearErrors();
          }
          else
          {
            echo $ratingData;
          }
        ?>
    PHP:
    Inside the escaped echoed tables below. THe php code above is placed inside the escaped tables below. But it is not parsing correctly.

    
    <?php echo '<table width="100%"  border="0" cellspacing="0" cellpadding="0" class="itemdetails">
    <tr>
    <td width="1100" height="350" bgcolor="#FFFFFF" class="tento">
    <table class="cafe"><tr><td width="547">
    <a href="#"><h3 align="justify" style="position:relative; height:5px; top: 10px;">',$row[2] ,'</h3></a>
    </td>
    </tr>
    </table>
    <table width="1215" height="609" class="chencho" >
     <td class="largethumb" rowspan="8" align="center">
    <a href="#"><img src="../images/image1.jpg" width="270" height="160" alt="coloe"/></a></td>
    <td width="340" rowspan="8" padding="0"  ><table width="252" style="font-size:12px; position:relative; top:-6px;">
      <td width="1">&nbsp;</td>
      <td width="54" bgcolor="#FFFFFF"><strong>Price:</strong></td>
      <td colspan="7">$<span class="style3">',$row[6] ,'</span></td>
    <tr>
      <td class="style1">&nbsp;</td>
      <td colspan="7" class="style3">&nbsp;</td>
    </tr>
    <tr><td>&nbsp;</td><td><strong>Raiting:</strong></td>
      <td><table height"50" width="47%">        
     <?php
          $ratingData = Rating::OutputRating($platename);
          
          if (Error::HasErrors())
          {
            echo Error::ShowErrorMessages();
            Error::ClearErrors();
          }
          else
          {
            echo $ratingData;
          }
        ?></table></td>
    </tr>'; 
    ?>
    PHP:
     
    co.ador, Jul 20, 2009 IP
  2. php-lover

    php-lover Active Member

    Messages:
    261
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    58
    #2
    Hi mate, here's how you'll do it.

    
    <?php
     
          $ratingData = Rating::OutputRating($platename);
         
          if (Error::HasErrors())
          {
            $rate = Error::ShowErrorMessages();
            Error::ClearErrors();
          }
          else
          {
            $rate = $ratingData;
          }
    
    
    echo '<table width="100%"  border="0" cellspacing="0" cellpadding="0" class="itemdetails">
    <tr>
    <td width="1100" height="350" bgcolor="#FFFFFF" class="tento">
    <table class="cafe"><tr><td width="547">
    <a href="#"><h3 align="justify" style="position:relative; height:5px; top: 10px;">',$row[2] ,'</h3></a>
    </td>
    </tr>
    </table>
    <table width="1215" height="609" class="chencho" >
     <td class="largethumb" rowspan="8" align="center">
    <a href="#"><img src="../images/image1.jpg" width="270" height="160" alt="coloe"/></a></td>
    <td width="340" rowspan="8" padding="0"  ><table width="252" style="font-size:12px; position:relative; top:-6px;">
      <td width="1">&nbsp;</td>
      <td width="54" bgcolor="#FFFFFF"><strong>Price:</strong></td>
      <td colspan="7">$<span class="style3">',$row[6] ,'</span></td>
    <tr>
      <td class="style1">&nbsp;</td>
      <td colspan="7" class="style3">&nbsp;</td>
    </tr>
    <tr><td>&nbsp;</td><td><strong>Raiting:</strong></td>
      <td><table height"50" width="47%">       
    '.$rate.'</table></td>
    </tr>';
    ?>
    PHP:
     
    php-lover, Jul 21, 2009 IP
  3. mioot

    mioot Peon

    Messages:
    169
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    <?php echo '<table width="100%" border="0" cellspacing="0" cellpadding="0" class="itemdetails"><tr><td width="1100" height="350" bgcolor="#FFFFFF" class="tento"><table class="cafe"><tr><td width="547"><a href="#"><h3 align="justify" style="position:relative; height:5px; top: 10px;">',$row[2] ,'</h3></a></td></tr></table><table width="1215" height="609" class="chencho" ><td class="largethumb" rowspan="8" align="center"><a href="#"><img src="../images/image1.jpg" width="270" height="160" alt="coloe"/></a></td><td width="340" rowspan="8" padding="0" ><table width="252" style="font-size:12px; position:relative; top:-6px;"><td width="1">&nbsp;</td><td width="54" bgcolor="#FFFFFF"><strong>Price:</strong></td><td colspan="7">$<span class="style3">',$row[6] ,'</span></td><tr><td class="style1">&nbsp;</td><td colspan="7" class="style3">&nbsp;</td></tr><tr><td>&nbsp;</td><td><strong>Raiting:</strong></td><td><table height"50" width="47%">';

    $ratingData = Rating::OutputRating($platename);

    if (Error::HasErrors())
    {
    echo Error::ShowErrorMessages();
    Error::ClearErrors();
    }
    else
    {
    echo $ratingData;
    }

    echo '</table></td></tr>';


    ?>
     
    mioot, Jul 21, 2009 IP
  4. Martinoes

    Martinoes Peon

    Messages:
    110
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    <?php echo '<table width="100%"  border="0" cellspacing="0" cellpadding="0" class="itemdetails">
    <tr>
    <td width="1100" height="350" bgcolor="#FFFFFF" class="tento">
    <table class="cafe"><tr><td width="547">
    <a href="#"><h3 align="justify" style="position:relative; height:5px; top: 10px;">',$row[2] ,'</h3></a>
    </td>
    </tr>
    </table>
    <table width="1215" height="609" class="chencho" >
     <td class="largethumb" rowspan="8" align="center">
    <a href="#"><img src="../images/image1.jpg" width="270" height="160" alt="coloe"/></a></td>
    <td width="340" rowspan="8" padding="0"  ><table width="252" style="font-size:12px; position:relative; top:-6px;">
      <td width="1">&nbsp;</td>
      <td width="54" bgcolor="#FFFFFF"><strong>Price:</strong></td>
      <td colspan="7">$<span class="style3">',$row[6] ,'</span></td>
    <tr>
      <td class="style1">&nbsp;</td>
      <td colspan="7" class="style3">&nbsp;</td>
    </tr>
    <tr><td>&nbsp;</td><td><strong>Raiting:</strong></td>
      <td><table height"50" width="47%">        
     <?php
          $ratingData = Rating::OutputRating($platename);
          
          if (Error::HasErrors())
          {
            echo Error::ShowErrorMessages();
            Error::ClearErrors();
          }
          else
          {
            '.$ratingData.';
          }
        ?></table></td>
    </tr>'; 
    ?>
    PHP:
     
    Martinoes, Jul 21, 2009 IP