Page 1 of 1

echo's not working in table

Posted: Sat Feb 28, 2009 2:07 pm
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!

Re: echo's not working in table

Posted: Sat Feb 28, 2009 2:13 pm
by greyhoundcode
Try using PHP tags, like this:

Code: Select all

<TD><?php echo $item_short_desc; ?></TD>

Re: echo's not working in table

Posted: Sat Feb 28, 2009 2:41 pm
by imimin
That did it, thank you!