谁能告诉我在这段代码中哪个ajax变量负责数据库更新?

时间:2012-03-20 16:47:01

标签: php ajax

Here is the code ..

我想将该代码克隆到另一个名为“Reputation”的模块中。

This is what i done so far。但是,当我点击更新它实际上更新点而不是声誉。

Here is the difference of two files

我从未使用过ajax。所以我对那个ajax部分很困惑。

那么有谁能告诉我哪些行负责数据库更新?..

由于

1 个答案:

答案 0 :(得分:1)

/wp-admin/admin-ajax.php正在使用发送给它的参数进行更新。

这是代码的一部分。

 jQuery.post('<?php echo bloginfo('url').'/wp-admin/admin-ajax.php'; ?>',
     {
         action: 'cp_manage_form_submit',
         user_id: user_id,
         points: points
     }

这里是设置“points”变量的代码:

 points = jQuery(this).children('input[name=cp_manage_form_points]').val();

表示在提交的表单中获取<input name="cp_manage_form_points">的值。