Search code examples
phpinternal-server-errorbootstrap-switch

bootstrap Switch - on change state update db - internal server error


This is my first time using the bootstrap switch. Im trying to update data on the database when it changes the state.

So i have

<input type="checkbox" name="published" <?php echo ($published  == 1 ? 'checked' : ''); ?>>

$('input[name="published"]').on('switchChange.bootstrapSwitch', function() {
$.post("functions/dashsettings.php",
    {
        action: "publish"
    });
});

when it change the state, im getting:

POST www.mydomain.com/user/functions/dashsettings.php 500 (Internal Server Error)


Solution

  • Stupid mistake with requiring files.

    i was able to find looking into the error logs.