Jump to content

very simple code for displaying file structure and select one image?


wmguk

Recommended Posts

hey guys,

 

I am looking about and i just need a very simple code that will display the contents of http://domain.co.uk/clients/$login and allow the user to pick one of the images shown, and just store the filename in a field on the database. I can do the add the name to the database but I cannot find any really simple code to just display and select the image.

 

I tried to use the AJAX simple file browser, but that has 5 pages and doesnt seem to allow anyway to have the $login variable passed, so has anyone got any ideas.

 

very very very simple, just display a 100px thumbnail and click it. - that either then files a text box with the name and click submit to enter in to the database, or just on click and name is entered.

 

Thanks in advance

You can go here and get a thumbnail generator

 

http://www.phpfreaks.com/forums/index.php/topic,191541.0.html

 

Then use this to show the pictures

<?php
$image_path = $login.'/images/';
$files = glob($login.'*.jpg';
foreach($files as $f){
  echo "<a href=\"processpic.php?$f\"><img src=\"imageresize.php?maxsize=100&source=$f\" /></a>\n";
}
?>

 

Replace processpic.php with the page you will use to insert the picture name.

 

Ray

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.