Jump to content


Photo

Displaying images from a folder


  • Please log in to reply
5 replies to this topic

#1 MPT

MPT
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 26 April 2006 - 03:30 PM

Hi there,

I'm very new with PHP so I hope my question has all information needed for an acucrate response. I will also link the page to show what I have done already if that is permitted (I dont want it to come off as advertising)

Here's what im trying to accomplish:

I have created a page that will allow a user to upload image files to designated folders. I want to make it where all files in those folders are able to be displayed one at a time with a Beginning, previous, next, last navigation. (<< < > >>) I think I can handle the navigation, but any pointers on how to display images from a folder would be AWESOME!

Also, could a mod let me know if I can display the page I have created already?

Thanks in advance.

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 26 April 2006 - 03:41 PM

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Also, could a mod let me know if I can display the page I have created already?[/quote]
Yes you may, You can post it as a screenshot or post a link to your current page. Also you can post your code here too, provided that you use the code blocks ([ code]code here[/code] with out the space in the first code tag).

#3 MPT

MPT
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 27 April 2006 - 01:57 PM

Thanks Wild,

Here is a link to the page I have already created. Keep in mind that this is only the uploading page. I If you check out the top right corner of each upload panel, there is a link that directs you to the folder where the files are being uploaded. Those folders are the ones I'd like to display as images on another page.

[a href=\"http://www.effluximages.com/testbed/upload2/satstuupload.php\" target=\"_blank\"]upload page link, click here[/a]

Thanks much

#4 wisewood

wisewood
  • Members
  • PipPipPip
  • Advanced Member
  • 226 posts
  • LocationRotherham, England

Posted 27 April 2006 - 03:20 PM

dont know if this will be what you're after...
but might help

<?php
foreach (glob("*.jpg") as $filename) 
{
echo "<IMG SRC='$filename' ALT='$filename'><br>";
}
?> 

this will select all the .jpg files in the directory and display them as an image.
wisewood: proven fact, I am both wise, and wooden.

#5 MPT

MPT
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 27 April 2006 - 03:39 PM

take a look at the same link I listed above now. Have it pretty much figured out now :D The only thing I need now is to make the "end" button :P

#6 MPT

MPT
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 27 April 2006 - 08:41 PM

[!--quoteo(post=369258:date=Apr 27 2006, 11:20 AM:name=wisewood)--][div class=\'quotetop\']QUOTE(wisewood @ Apr 27 2006, 11:20 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
dont know if this will be what you're after...
but might help

<?php
foreach (glob("*.jpg") as $filename) 
{
echo "<IMG SRC='$filename' ALT='$filename'><br>";
}
?> 

this will select all the .jpg files in the directory and display them as an image.
[/quote]

thats awesome! It would be really cool if each image could be put in a table cell!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users