View Full Version : load into table

03-18-2004, 11:48 PM

Sorry im new to .php, but is it possible to load say a background image to a table id?

<table width="750" height="600" <?php include "images.php"; ?>>I need to load this into my main table as a background:
//This is the directory route to the folder
//This is a relative link to the directory if it is not in the same directory as the file you are displaying the images on

die("Failed to read directory");
if(ereg($pattern, $s))

//Spit it out
echo "<br><img src=\"$directory$image[$randNum]\" $size[3]>";
?>I have come up with this Test Page (http://www.britishrallying.com/test.php) but i need it to be embedded into the table. Ive put <?php include "images.php"; ?> between the <td> </td>tags

Think I have confused my self again!:)

Thanks in advance,


03-19-2004, 08:26 AM
just change the HTML in your image.php (there are other ways but this is the quickest fix)

echo "background=\"$directory$image[$randNum]\"";

03-19-2004, 11:09 AM
Nice one firepages.

It Works (http://www.britishrallying.com/test1.php)

I've called it into the table as below, is this the right way of doing it, i shouldnt really say anything as it works!!:)
<table <?php include "images.php"; ?> width="750" height="600" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#006bad" id="Main">I was wondering if there was away like with javascript you call php to say the id of a table?
document.getElementById('main').style.background="white url("+img.src+") no-repeat fixed top"Thanks,