Jump to content

PHP inside echo's


Andrew R

Recommended Posts

Hi

 

How would I insert this (below) inside an echo that contains html?             

 

 

<?php do { ?>

 

<?php } while ($row_bh = mysql_fetch_assoc($bh)); ?>

 

 

 

<? if ($ree == 'YES') {
	  echo"<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"bar\">
              <!--DWLayoutTable-->
              <tr> 
                <td width=\"249\" height=\"18\" valign=\"top\"><strong>TEEST</strong> </td>
                <td width=\"590\"></td>
              </tr>
            </table>
<table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"3\" bgcolor=\"#F5F5F5\" class=\"border\">
              <!--DWLayoutTable-->
              <tr> 
                <td width=\"121\" height=\"22\" valign=\"top\" bgcolor=\"#CCCCCC\" class=\"bar2\">1 </td>
                <td width=\"95\" valign=\"top\" bgcolor=\"#CCCCCC\" class=\"bar2\">2</td>
                <td width=\"96\" valign=\"top\" bgcolor=\"#CCCCCC\">3</td>
                <td width=\"93\" valign=\"top\" bgcolor=\"#CCCCCC\">4</td>
                <td width=\"96\" valign=\"top\" bgcolor=\"#CCCCCC\">5</td>
                <td width=\"100\" valign=\"top\" bgcolor=\"#CCCCCC\">6</td>
                <td width=\"104\" valign=\"top\" bgcolor=\"#CCCCCC\">7e</td>
                <td width=\"77\" valign=\"top\" bgcolor=\"#CCCCCC\" class=\"bar2\"><!--DWLayoutEmptyCell--> </td>
              </tr>

              <tr> 
                
    <td height=\"23\" valign=\"middle\"></td>
    <td valign=\"top\"><td>
    <td valign=\"top\">< td>
    <td valign=\"top\"></td>
    <td valign=\"top\"></td>
    <td valign=\"top\"></td>
    <td valign=\"top\"></td>
                
    <td align=\"right\" valign=\"middle\"><!--DWLayoutEmptyCell--> </td>
            </table>";



}

	  ?>

 

How would I put the php inside the echo without getting errors

 

Cheers  :)

Link to comment
Share on other sites

If you don't want to escape all those quotes you can always do

<?
if ( $boolean )
{
?>
Lots of html and stuff could go here like this<br />
<?= $var ?> is also a cool shortcut to embedding php into HTML without having to type out a whole lot.
<img src="img.jpg" alt="nowai" />
<?
}
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.