SitePoint Sponsor

User Tag List

Page 2 of 2 FirstFirst 12
Results 26 to 29 of 29
  1. #26
    SitePoint Evangelist ColinHughes's Avatar
    Join Date
    Sep 2004
    Location
    Spain
    Posts
    471
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK Had some time to work with this during the morning and discovered the culprit is related to these statements

    PHP Code:

    for($i=0;$i<count($_FILES['foto']['tmp_name']);$i++): // Loop through array of images

    if($_FILES['foto']['tmp_name']['$i']): // OBVIOUSLY NOT BECAUSE QUERY DOES NOT RUN 
    The array prints as

    Array ( [name] => Array ( [0] => featured.jpg [1] => calendar.jpg [2] => buyers.jpg [3] => beach.jpg [4] => search_image.jpg [5] => search-button.jpg [6] => [7] => [8] => [9] => ) [type] => Array ( [0] => image/jpeg [1] => image/jpeg [2] => image/jpeg [3] => image/jpeg [4] => image/jpeg [5] => image/jpeg [6] => [7] => [8] => [9] => ) [tmp_name] => Array ( [0] => C:\Windows\Temp\php8FE2.tmp [1] => C:\Windows\Temp\php8FF3.tmp [2] => C:\Windows\Temp\php9013.tmp [3] => C:\Windows\Temp\php9014.tmp [4] => C:\Windows\Temp\php9015.tmp [5] => C:\Windows\Temp\php9016.tmp [6] => [7] => [8] => [9] => ) [error] => Array ( [0] => 0 [1] => 0 [2] => 0 [3] => 0 [4] => 0 [5] => 0 [6] => 4 [7] => 4 [8] => 4 [9] => 4 ) [size] => Array ( [0] => 167178 [1] => 1679334 [2] => 13781 [3] => 12195 [4] => 1955 [5] => 48297 [6] => 0 [7] => 0 [8] => 0 [9] => 0 ) )

    echoing value of $i gives
    value is now 0
    value is now 1
    value is now 2
    value is now 3
    value is now 4
    value is now 5
    value is now 6
    value is now 7
    value is now 8
    value is now 9

    So the loop is working

  2. #27
    SitePoint Evangelist ColinHughes's Avatar
    Join Date
    Sep 2004
    Location
    Spain
    Posts
    471
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No values for tmp_name ??

  3. #28
    SitePoint Wizard bronze trophy Jeff Mott's Avatar
    Join Date
    Jul 2009
    Posts
    1,265
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    ['$i']

    should be

    [$i]
    "First make it work. Then make it better."

  4. #29
    SitePoint Evangelist ColinHughes's Avatar
    Join Date
    Sep 2004
    Location
    Spain
    Posts
    471
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Jeff Mott View Post
    ['$i']

    should be

    [$i]
    GROAN!! Thanks


Bookmarks

Posting Permissions

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