echo's not working in table

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
imimin
Forum Commoner
Posts: 38
Joined: Thu Oct 18, 2007 5:44 pm

echo's not working in table

Post by imimin »

Could someone please tell me what I am doing wrong in my coding? I am trying to GET variable that is passed from previous page, that works fine, I am sure. Where I have a problem is when I try to echo my variables in different TD's in in a table. I am sure it is my syntax, but I can not figure out what i am doing wrong. Can someone please help em out here?

Code: Select all

<table style="width: 100%" cellspacing="0" cellpadding="0">
 
            <?php
            $item_short_desc = $_GET['item_short_desc'];
            $item_img = $_GET['item_img'];
            ?>
 
    <TABLE WIDTH="100%" ALLIGN="left" BORDER=0 CELLPADDING=4>
 
    <TR>
        <TH ROWSPAN=3> echo <IMG SRC=\includes/img_resize3.php?src=$sitelocation$item_img&width=500&height=500&qua=50\" BORDER=\"0\"></TH>
        <TD>&nbsp;</TD> <TD>1493</TD>
        </TR>
    <TR>
        <TD>&nbsp;</TD> <TD>3829</TD>
        </TR>
    <TR>
        <TD>&nbsp;</TD> <TD>echo $item_short_desc</TD>
        </TR>
    </TABLE>
Notice the echo's on lines 11 and 18.

Thank you!
User avatar
greyhoundcode
Forum Regular
Posts: 613
Joined: Mon Feb 11, 2008 4:22 am

Re: echo's not working in table

Post by greyhoundcode »

Try using PHP tags, like this:

Code: Select all

<TD><?php echo $item_short_desc; ?></TD>
imimin
Forum Commoner
Posts: 38
Joined: Thu Oct 18, 2007 5:44 pm

Re: echo's not working in table

Post by imimin »

That did it, thank you!
Post Reply