My company's website has run into a peculiar issue.
On our quote form we have an HTML5 drag and drop file upload. On modern browsers (>=IE10) everything submits via AJAX with FormData and everything is amazing. However, in crappy browsers and mobile devices (since there is no drag and drop), we simply just provide a standard file upload and submit like a normal form (no AJAX).
if(modern_browser)
{
// Do modern things
}
else
{
$('#theformid').submit();
}
The PHP code on the page that's presenting the form checks for the server request method (POST) and then processes the form. Works fine on our local development server and on my localhost.
HOWEVER
On the production server the request method is always GET, even though the form's method attribute is set to post, so the check fails and the page simply just reloads. Not only is it GET, but it doesn't have any of the form's data stored (so I can't even tell the code to take all the GET values and keep moving forward). No PHP errors, no console errors.
We thought it may be a PHP thing since the production server was running 5.4.45, and our development server and my localhost were running 5.5.6 and 5.6.15, respectively. But we upgraded the PHP version on the production server to 5.6.17 and problem persisted. I even thought maybe it was a jQuery issue and tried referencing and submitting the form with vanilla JavaScript but it didn't matter.
The way we got around it was to submit the form via AJAX anyway but instead of using FormData we're simply just submitting regular key:value pairs and removing the file upload option.
Googling has revealed nothing other than a bunch of people telling me to double check the form's method attribute.
Any thoughts? Even though the issue has been "solved" I am still curious what the hell was going on.
Thanks in advance!