php $_POST array empty upon form submission

前端 未结 27 3412

I have a custom CMS i\'ve built that works perfectly on my dev box (Ubuntu/PHP5+/MySQL5+).

I just moved it up to the production box for my client and now all form su

27条回答
  •  面向向阳花
    2020-11-22 09:57

    In my case it was because I was using jQuery to disable all inputs on the page just before using jQuery to submit the form. So I changed my "disable every input even the 'hidden' types":

    $(":input").attr("disabled","disabled"); 
    

    to "disable only the 'button' type inputs":

    $('input[type=button]').attr('disabled',true);
    

    This was so the user couldn't accidentally hit the 'go' button twice and hose up our DB! It seems that if you put the 'disabled' attribute on a 'hidden' type form input their values won't be sent over if the form is submitted!

提交回复
热议问题