cannot update images in the folder

This is a discussion on "cannot update images in the folder" within the PHP Forum section. This forum, and the thread "cannot update images in the folder are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Sep 17th, 2007, 19:00
Junior Member
Join Date: Nov 2006
Location: us
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
cannot update images in the folder

Hi,
I was uploading images thru cpanel, not sure why I cannot find those uploaded images on the add_culver.php page. There are 20 images that were uploaded long time ago, I can still see them through the pulldownmenus on add_culver.php in the browser, but not sure the current uploaded images are not listed in the pulldownmenus automatically, after uploaded those new images thru cpanel? Would you mind helping me to see what did I code wrong. Much appreciated!!!

PHP: Select all

<?php
                  
//execute code if images folder can be opened. or fail silently
                  
if($imageFolder = @opendir("culver/")){
                      
//create an array of image types
                      
$imageTypes = array('jpg','jpeg','gif','png');
                      
//Traverse images folder, and add filename to $img array if an image
                      
while(($imageFile readdir($imageFolder)) !==false){
                      
$fileInfo pathinfo($imageFile);
                      if(
in_array($fileInfo['extension'], $imageTypes)){
                      
$img[] = $imageFile;
                      }
                  }
                  
//close the string from the images fodler
                  
closedir($imageFolder);
                  
//check the $img array is not empty
                  
if($img){
                  
//sort in natural, case-insensitive order, and populate menu
                  
natcasesort($img);
                  foreach(
$img as $image){
                  echo 
"<option value='$image'>$image</option>\n";
                  }
              }
          }
          
?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Sep 18th, 2007, 08:09
Highly Reputable Member
Join Date: Apr 2007
Location: Willich, Germany
Age: 20
Posts: 592
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: cannot update images in the folder

I can't see any obvious errors, try looking what's in the $img array with var_dump or print_r before you output it in the foreach loop....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Sep 18th, 2007, 18:38
Junior Member
Join Date: Nov 2006
Location: us
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Re: cannot update images in the folder

Quote:
Originally Posted by c010depunkk View Post
I can't see any obvious errors, try looking what's in the $img array with var_dump or print_r before you output it in the foreach loop....
Thanks alot. I found the problem was the capitalized issue for the file extension(JPG).
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Viewing images in folder R8515198 Web Page Design 8 Dec 6th, 2007 08:13
Calling images in a banner from a folder ketansethi Flash & Multimedia Forum 4 Oct 28th, 2007 08:53
How can I link my ftp with my folder to have them auto update charlie019 Scripts and Online Services 4 Aug 4th, 2007 04:41
upload images in database and folder manzil PHP Forum 1 Aug 11th, 2006 16:06


All times are GMT. The time now is 13:20.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved