Jump to content

[SOLVED] Need help adding PHP code in HTML table tag!!!


dauzy

Recommended Posts

Hello,

 

I'm trying to calendar from a table and have the background change dynamically.  The problem that I'm having is that I'm having trouble having the php code echo out a new table with the table data background take in a variable... Here's the code which probably help explain my problem. 

 

if(in_array($day_num, $directory))

{

$something = "$day_num";

$something_good = ".jpg";

$something_real_good = "images/_calendar/July/calendar/"

$good_stuff = $something_real_good.$day_num.$something_good;

echo '<td width="145px" height="145px" background="<?php $something_real_good; ? >'.$day_num.'</td>';  <--- this is where i need help. 

 

                $day_num++;

$day_count++;

}

 

So when the code does the echo i want it to echo out if $day_num is 3...

 

echo '<td width="145px" height="145px" background="images/_calendar/July/calendar/3.jpg">'.$day_num.'</td>'; 

 

and when it goes to the HTML it will bring up that picture in that directory as the background....

 

Thanks for the help,

Dauzy

     echo '<td width="145px" height="145px" background="'.$something_real_good.'"'.$day_num.'</td>';  <--- this is where i need help.

     

 

it's already in php tags, so this is wrong

 

<?php $something_real_good ?>

 

the above should work

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.