|
Posted by shorty on 08/24/05 22:55
All I am after is file:///C:/mypath/banner2.jpg in the following html
code, to have an include statement added.
I have tried everything I can think of.
<body>
<div align="center">
<center>
<table border="0" cellspacing="0" style="border-collapse: collapse"
bordercolor="#111111" width="750" cellpadding="0" id="AutoNumber1"
height="180">
<tr>
<td width="100%" background="file:///C:/mypath/banner2.jpg"
height="161">
<b><font size="6" color="#FF0000"> TEST
TEST</font></b></td>
</tr>
<tr>
<td width="100%" height="19"> </td>
</tr>
</table>
</center>
</div>
</body>
All this included php program does is randomly changes the background
in a table cell, see below. The php code runs OK on its own.
<?php
/*
* Name your images 1.jpg, 2.jpg etc.
*
* Add this line to your page where you want the images to
* appear: <?php include "randomimage.php"; ?>
*/
// Change this to the total number of images in the folder
$total = "11";
// Change to the type of files to use eg. .jpg or .gif
$file_type = ".jpg";
// Change to the location of the folder containing the images
$image_folder = "images/random";
// You do not need to edit below this line
$start = "1";
$random = mt_rand($start, $total);
$image_name = $random . $file_type;
echo "<img src=\"$image_folder/$image_name\" alt=\"$image_name\" />";
?>
But i just cannot get the html formatting correct, Any ideas.
Navigation:
[Reply to this message]
|