jkkenzie Posted May 11, 2010 Share Posted May 11, 2010 echo "BEFORE <br>"; print_r($_FILES); if(!empty($_FILES['adphotos']) && !empty($_FILES['adphotos']['name'])){ echo "AFTER"; Print_r results to : Array ( [adphotos] => [adphotos2] => [adphotos3] => [adphotos4] => [adphotos5] => ) It looks empty? Iam trying to upload images but not going through: though i have selected several images to upload but nothing happens . It works on Local machine!! ? Quote Link to comment https://forums.phpfreaks.com/topic/201333-_files/ Share on other sites More sharing options...
Adam Posted May 11, 2010 Share Posted May 11, 2010 Perhaps seeing a little more of your code would help? Quote Link to comment https://forums.phpfreaks.com/topic/201333-_files/#findComment-1056271 Share on other sites More sharing options...
PFMaBiSmAd Posted May 11, 2010 Share Posted May 11, 2010 Having the array keys but no values for the $_FILES array is abnormal. Ether the whole $_FILES array will be empty (you exceeded the post max size setting) OR the key(s) will exist and you will have ['name'], ['error'], ... elements present, even if those elements are empty. You either have a logic error in your code that is overwriting the values under certain conditions or the web server/php is overwriting the values under certain conditions (i.e. the server has the Suhosin hardened php patch installed, register_globals are on, or the php installation is messed up.) As MrAdam replied, you can always get faster solutions to your problems in a help forum when you post all the relevant code so that the code can either be eliminated as the cause of the problem or someone can see what the code is doing that is causing the problem. Quote Link to comment https://forums.phpfreaks.com/topic/201333-_files/#findComment-1056383 Share on other sites More sharing options...
jkkenzie Posted May 11, 2010 Author Share Posted May 11, 2010 thanks guys! You are all right , though its kind of late. I solved the issue, it was magic_quotes_gpc which was off that was Cleaning http $_FILES . when enabled, everything worked perfect. thanks Quote Link to comment https://forums.phpfreaks.com/topic/201333-_files/#findComment-1056416 Share on other sites More sharing options...
PFMaBiSmAd Posted May 11, 2010 Share Posted May 11, 2010 Turning on magic_quotes_gpc is not a fix because it has been completely removed in upcoming php6. You are going to need to find what is causing the actual problem. Also, magic_quotes_gpc does not affect the upload data (it could be affecting what you see when you echo/print_r things to your browser if there are any quotes in the form field names or file names.) And php has had some bugs concerning magic_quotes_gpc in their efforts in php5.3.x getting ready to remove it. What php version are you using? Quote Link to comment https://forums.phpfreaks.com/topic/201333-_files/#findComment-1056423 Share on other sites More sharing options...
Daniel0 Posted May 11, 2010 Share Posted May 11, 2010 Turning on magic_quotes_gpc is not a fix because it has been completely removed in upcoming php6. Magic quotes hasn't been removed from anywhere: daniel@daniel-laptop:~/projects/php/php/php-src/trunk$ sapi/cli/php --version; sapi/cli/php -i | grep magic PHP 5.3.99-dev (cli) (built: Apr 21 2010 15:24:13) Copyright (c) 1997-2010 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2010 Zend Technologies magic_quotes_gpc => On => On magic_quotes_sybase => Off => Off magic_quotes_runtime => Off => Off The fate of magic quotes is undecided, and so is the feature set of PHP 6. Quote Link to comment https://forums.phpfreaks.com/topic/201333-_files/#findComment-1056453 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.