Soldato
- Joined
- 24 Nov 2002
- Posts
- 16,378
- Location
- 38.744281°N 104.846806°W
I have :
To display all the pictures in a directory. However, i want to do two things to this,
1 - make it work. For some reason, the $imagenoe doesn't work, I've tried to strip the extension and just display the file name - but it hasn't worked.
2 - There are thumbnails in the dir which have the format file.thumb.extension, I would like those to not be displayed.
Also, I have:
To display the picture on change and sort the dirs out. However, I don't know how to make "$extension" display the extension. Perahps using $ext = strrchr($file, "."); ?
Can you guys see what I'm trying to do?
I'm trying to have a drop down box that display all the images in a dir. However, I want the "value" of the box to be the TRUE filename + extension of the large image, however, I wan the picture displayed the thumbnail version.
The reason i want the true filename displayed (1.jpg not the thumbmail pic: 1.thumb.jpg) as as I want to give the option (passworded) of delete the image AND its associated thumbnail file.
Code:
<form name="goit">
<select name="select" onChange="preview();">
<option selected value="white.gif"></option>
<?
$dir_handle = @opendir('../pics');
if ( !$sort ){
while ($file = readdir($dir_handle)) {
if ($file != '.htaccess' && $file != '.' && $file != '..' && $file != 'index.php' && $file != 'template.php' && $file != 'white.gif'){
echo "<option value=\"$file\">$imagenoe</option>";
}
}
}
closedir($dir_handle);
echo "</select>";
echo "<br><br><img src=\"white.gif\" name=\"pic\" id=\"pic\">";
$imageoe = str_replace (".","", strrchr ($file,"."));
?>
To display all the pictures in a directory. However, i want to do two things to this,
1 - make it work. For some reason, the $imagenoe doesn't work, I've tried to strip the extension and just display the file name - but it hasn't worked.
2 - There are thumbnails in the dir which have the format file.thumb.extension, I would like those to not be displayed.
Also, I have:
Code:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function preview() {
if (document.goit.select.value == "white.gif") {
document.pic.src = + document.goit.select.value;
} else {
document.pic.src = "../pics/" + <?php echo $imageoe ?> + ".thumb" + <?php echo $extension ?> +;
}
}
</script>
To display the picture on change and sort the dirs out. However, I don't know how to make "$extension" display the extension. Perahps using $ext = strrchr($file, "."); ?
Can you guys see what I'm trying to do?
I'm trying to have a drop down box that display all the images in a dir. However, I want the "value" of the box to be the TRUE filename + extension of the large image, however, I wan the picture displayed the thumbnail version.
The reason i want the true filename displayed (1.jpg not the thumbmail pic: 1.thumb.jpg) as as I want to give the option (passworded) of delete the image AND its associated thumbnail file.
Last edited: