MadnessRed Posted May 21, 2008 Share Posted May 21, 2008 OK, I have a random image selector and I want it to get the image from a path specified by another file here is my code at current <a href="<?php readfile('data/profile/gallery.txt'); ?>" target="_new"> <?php //This will get an array of all the .jpg images in a folder $img_array = glob([color=red]readfile('data/profile/gallery.txt')[/color] . *.jpg"); //Pick a random image from the array $img = array_rand($img_array); //Display the image on the page echo '<img alt="'.$img_array[$img].'" src="'.$img_array[$img].'" width=300 />'; ?> </a> how should I be writing that? Link to comment https://forums.phpfreaks.com/topic/106677-readfile-inside-a-php-script/ Share on other sites More sharing options...
MadnessRed Posted May 21, 2008 Author Share Posted May 21, 2008 actually dont worry as ever if i got it working it wouldnt work the way i wanted it Link to comment https://forums.phpfreaks.com/topic/106677-readfile-inside-a-php-script/#findComment-546852 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.