dauzy Posted July 16, 2008 Share Posted July 16, 2008 Sooo I've been trying for hours to make picture dynamically change when needed...The probably I'm having right now is having the <td> take in a php variable in for a background. Heres my code: if(in_array($day_num, $directory)) { $something = "$day_num"; $something_good = ".jpg"; $something_real_good = 'background="images/_calendar/July/calendar/3.jpg"'; $good_stuff = $something_real_good.$day_num.$something_good; echo '<td width="145px" height="145px" <?php $something_real_good; ? >'.$day_num.'</td>'; $day_num++; $day_count++; echo $something_real_good; //echo $good_stuff; //echo $day_num; } else { echo '<td width="145px" height="145px" background="images/_calendar/July/calendar/default.jpg">'.$day_num.'</td>'; $day_num++; $day_count++; } Link to comment https://forums.phpfreaks.com/topic/114992-need-help-adding-php-code-in-html-table-tag/ Share on other sites More sharing options...
waynew Posted July 16, 2008 Share Posted July 16, 2008 Double post. Link to comment https://forums.phpfreaks.com/topic/114992-need-help-adding-php-code-in-html-table-tag/#findComment-591372 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.