Ask a Question related to Macromedia Exchange Dreamweaver Extensions, Design and Development.
-
rmartine2007 #1
PHP Random Image extension
I am trying to use the PHP random image generator but I don't know where to
specify the size I want all the pictures to come up in the code. I created a
"php" test page and inserted said code where I want the images to display but
they are too large and throw the entire page off. Is there a way to tell it
that all pictures should be called up at 240(width) x 350(height)? Any help
would be greatly appreciated. The reason I am doing this is because there are
about 200 images (of students) in this folder and coding each picture
seperately is too time consuming.
Regards,
RM (using DW MX2004)
<?php
$folder=opendir("testwisdroyphppics/");
while ($file = readdir($folder))
$names[count($names)] = $file;
closedir($folder);
sort($names);
$tempvar=0;
for ($i=0;$names[$i];$i++){
$ext=strtolower(substr($names[$i],-4));
if
($ext==".jpg"||$ext==".gif"||$ext=="jpeg"||$ext==" .png"){$names1[$tempvar]=$name
s[$i];$tempvar++;}
}
srand ((double) microtime() * 10000000);
$rand_keys = array_rand ($names1, 2);
$xmImg="testwisdroyphppics/".$names1[$rand_keys[0]];
$dimensions = GetImageSize($xmImg);
if (isset($pic)){header ("Location: $xmImg");}
else {echo "<img src=\"$xmImg\" $dimensions[3]>";}
?><
rmartine2007 Guest
-
Looking for a random image extension
Does anybody know of a good FREE extension that will put a random image inside a cell of a table? I'm actually looking to do two different... -
Stopping the same random image
Hi, I am loading 8 images into 8 movie clips using a random number generator. it is working but it loads in the same images in places. I need the... -
Random image display
I am doing a website, www.jishanair.com/test I currently on the homepage have a huge image, which i want to change randomly whenever someone... -
Random image?
Is there a way to create a random image (like in hotmail registration) and ask user to enter the information during their registration. I think,... -
Random image in a random place.
Anyone know javascript? I have a grid(4 x 4) of 16 spacer images and a few text links on the side. Each text link represents a different folder of... -
rmartine2007 #2
Re: PHP Random Image extension
Disregard....I figured it out. As it turns out the best solution would be to
have your original pictures saved with the desired dimensions. I was able to
point the PHP to a directory that contained pictures with said dimensions and
it worked like a charm.
regards.
rmartine2007 Guest



Reply With Quote

