Having that empty array means that the image is not being passed through with the form, maybe the file size is too big or there is some other error with the file (have you got any checks in place for situations like this)?
It cannot be anything to do with the code on your receiving page as the error is Undefined Index, meaning the variable $salesimage has received no value (no data has been posted for the image), and this has been confirmed by you printing out the file array and it being empty.
I have just noticed that you have no action defined in your opening form tag so how are you actually sending the form data to the script?? Change it to
And see if that helps. If not then I have no other solutions or suggestions apart from stripping all the other form elements and php out apart from those elements related to the file upload and see if it works then and if so, slowly add bits back in to find what is causing the issue.
I ran a test of this code, with a few modifications since I don't have your database, and I didn't receive any errors. Perhaps your error isn't with this code, but some kind of configuration setting on your server or something. Have you tried changing your error reporting settings to give you more details on the error.
copy and save whateverFileNameYouWant.php, upload to your server, and then direct your browser to this file..
Look for the following values, and they should have something more than 2MB at least 100MB or higher depending on your application
If those above php.ini settings still on the default value you need to change them.. To change it, you need to ask your host. If you are testing it on WAMPP or XAMPP, look for the loaded configuration file on the page above..
Loaded Configuration File // this should have a value of /php/php.ini depending on your server setttings
If your host does not allow you modify your php.ini file look for the "server API" value of your server". Is it fast CGI? or is it Apache Module?
If it is CGI, FAST CGI, or anything with CGI. create a new file and save it as php.ini. paste codes below to this file
post_max_size = 200M
upload_max_filesize = 200M
Upload this file to the root directory of your server or your domain...CANNOT be in the same level as the public_html file.
If server API says, apache module.. create a new document on your notepad and save it as .htaccess