Ajax & WordPress on Front End - Database not updating

前端 未结 4 1800
离开以前
离开以前 2021-01-14 17:59

So I\'m working on a WordPress website. I\'m having a bit of a difficult time getting the user input to update the database.

JS:

var ID = $(this).at         


        
4条回答
  •  悲&欢浪女
    2021-01-14 18:26

    I'm quite sure that you didn't send POST data to PHP file - check it. Type var_dump($_POST) in php, and add console.log(html) in success part of ajax.

    Try also change your dataString variable in JS to this:

    var dataString = {
     id:ID,
     name:name,
     createDate:createDate,
     stats:stats,
     dateExpire:dateExpire
    };
    

提交回复
热议问题