Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Oct 2011
    Posts
    65
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Echoing all images uploaded (max of 10)

    Hi guys,

    I'm hoping to get some assistance on echoing all images that are being uploaded. I've currently coded just to echo one image to ensure everything is working which it is (good start). So now I want to proceed on echoing every image that is uploaded (maxium of 10 images)... i'm not sure what the best way to go about it is.

    I was thinking using
    PHP Code:
    foreach($_FILES['images'] as $k => $v
    but not quite sure...

    Here is my code so far
    HTML
    Code:
    <form method="POST" encrtype="multipart/form-data">
    <input type="file" name="images" class="uploadimages"><input type="submit" name="upload" value="Upload"></form>
    php
    PHP Code:
    if(isset($_FILES['images']))
    {
    $name=$_FILES['images']['name'];
    $temp=$_FILES['images']['tmp_name'];
    $path='../CustomerUpload/ ' rand(0,1000)) . '.jpg';

    echo 
    "<img src=\"$path\" height=\"100\" width=\"100\" class=\"appearance\">";

    move_uploaded_image $tmp$path)
    }
    else
    {
    echo 
    ' No Images Uploaded';


  • #2
    Regular Coder
    Join Date
    Apr 2004
    Posts
    298
    Thanks
    0
    Thanked 23 Times in 23 Posts
    are you storing the image path/name in a database?
    if there are more than 10 images, do you want the most recent or some other criteria to choose which to display?

  • #3
    New to the CF scene
    Join Date
    May 2013
    Location
    India
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Echoing all images uploaded (max of 10)

    I gone through web and found an useful resource. Maybe it will help you.

    Check out this : answers.yahoo.com/question/index?qid=20110905200745AANp1XP

  • #4
    New Coder
    Join Date
    Oct 2011
    Posts
    65
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by litebearer View Post
    are you storing the image path/name in a database?
    if there are more than 10 images, do you want the most recent or some other criteria to choose which to display?
    Images will be stored into a database, yes.

    I was hoping to only give the user the ability to upload 10 images not allowing them to upload anymore. So it would simply echo all 10 images (5 images in width) so perhaps hidding the upload form if there are 10 images?

  • #5
    New Coder
    Join Date
    Oct 2011
    Posts
    65
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by rexhvn View Post
    Images will be stored into a database, yes.

    I was hoping to only give the user the ability to upload 10 images not allowing them to upload anymore. So it would simply echo all 10 images (5 images in width) so perhaps hidding the upload form if there are 10 images?
    Bump?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •