Jump to content

Recommended Posts

  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!!

?

Link to comment
https://forums.phpfreaks.com/topic/201333-_files/
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/201333-_files/#findComment-1056383
Share on other sites

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?

Link to comment
https://forums.phpfreaks.com/topic/201333-_files/#findComment-1056423
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/201333-_files/#findComment-1056453
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.