CaptainB
09-26-2009, 07:47 PM
Hi there,
Basicly, on my website I have an img tag which links to a .php file which displays a random image from a specified directory.
When I type the adress of the PHP file in the browser, the images display. However, on the page with the img tag, nothing shows.
Here's my folder structure:
Page with img tag: cms/themes/test/template.php
Img file: cms/themes/test/images/gallery/img.php
Images: cms/themes/test/images/gallery/
<img id="img" src="<?=$pth['folder']['templateimages']?>/gallery/img.php" alt=""/>
<?php
$folder = '.';
$images = glob( $folder . '/*.{jpg,JPG,gif,png}', GLOB_BRACE );
$image = basename( $images[ array_rand( $images ) ] );
echo '<img src="' . $folder . '/' . $image . '" alt="' .Gallery. '" />';
?>
I've tried to modify the paths both in the php file and on the page - nothing happens.
Basicly, on my website I have an img tag which links to a .php file which displays a random image from a specified directory.
When I type the adress of the PHP file in the browser, the images display. However, on the page with the img tag, nothing shows.
Here's my folder structure:
Page with img tag: cms/themes/test/template.php
Img file: cms/themes/test/images/gallery/img.php
Images: cms/themes/test/images/gallery/
<img id="img" src="<?=$pth['folder']['templateimages']?>/gallery/img.php" alt=""/>
<?php
$folder = '.';
$images = glob( $folder . '/*.{jpg,JPG,gif,png}', GLOB_BRACE );
$image = basename( $images[ array_rand( $images ) ] );
echo '<img src="' . $folder . '/' . $image . '" alt="' .Gallery. '" />';
?>
I've tried to modify the paths both in the php file and on the page - nothing happens.