Reputation: 45
I have a PHP customer setup page that has worked for several months with no changes to the page code. On this page I save a var (char 255) to my DB that contains a storage path where I keep customer uploads. My page now gives me a 406 Not Acceptable error code when saving a new entry or updating an existing one. I spent an hour with Godaddy tech support and they couldn't find anything wrong. They suggested I "google" it.
What I have found is if I store this in the var
../public/uploads/demo1/ it works fine.
But if I store this
../../public/uploads/demo1/ OR ../../../public/uploads/demo1/ I get the 406 error. The correct path that I need is the one with ../../../
I can go directly to the DB through MySql Workbench and enter the ../../../ path manually and everything works. I can recall from the DB with no problems I just cannot update or save a new entry.
}elseif (isset($_POST['update'])) {
//query DB and push all values to record
$dbusername = trim($_POST['username']);
if (has_presence($dbusername)) {
$dbusername = trim($_POST['username']);
$docstorage=$_POST['docstorage'];
$query = "UPDATE customers SET dbusername='$dbusername', docstorage='$docstorage', ' WHERE dbusername='$dbusername'";
$result = mysqli_query($connection, $query);
$arrayresult2 = mysqli_fetch_array($result);
Godaddy Hosting, PHP 5.6.30, error_log is empty
Complete error:
Not Acceptable
An appropriate representation of the requested resource /scratch/admin/users.php could not be found on this server.
Additionally, a 406 Not Acceptable error was encountered while trying to use an ErrorDocument to handle the request.
Thanks for any help!
Upvotes: 0
Views: 1431
Reputation: 45
Ok got this fixed.
I broke down my code to a single input box and a "save" button. Anything more than ../ would not save to my DB. So I ruled out any of my code and called Godaddy again.
It turned out to be a mod security setting. Godaddy updated their security filters and this function stopped working for me. I'm on a shared server so I have no access to make changes myself, they had to do everything. So they white-listed a rule for me to get it working. Keep in mind if you have this problem and have a SSL certificate the host will need to white-list the http and https versions. I hope this helps someone in the future. It took me 3 weeks to resolve this!
Upvotes: 2