Laymans terms HMM. You have a spider playing games there with your site script urls only way I can think of that defcat would be empty as you select the category on uploadphoto.php and it is passed to uploadproduct in the url.
In the file bulkupload.php line 538 is this query
Code:
Content visible to verified customers only.
All your doing on that line is finding $defcat and making it '$defcat'