that is the server error log generated
[Sat Oct 23 19:39:50.880944 2021] [:error] [pid 14841:tid 47226270963456] [client 61.245.170.73:48465] [client 61.245.170.73] ModSecurity: Warning. Match of "rx /wc-api/KCO_WC_Validation/" in opposition to "REQUEST_URI" required. [file "/etc/apache2/conf.d/modsec_vendor_configs/imunify360-full-apache/002_i360_1_infectors.conf"] [line "51"] [id "77140164"] [msg "IM360 WAF: Infectors: PHP Injection Low value||T:APACHE||MVN:REQUEST_URI||MV:/wp-admin/admin-ajax.php||SC:/home2/mrcstude/ictknowledgehub.com/wp-admin/admin-ajax.php"] [severity "DEBUG"] [tag "service_o"] [tag "service_i360"] [hostname "www.ictknowledgehub.com"] [uri "/wp-admin/admin-ajax.php"] [unique_id "YXRlBmtzrVqCoVAH4CfJFgAATws"], referer: https://www.ictknowledgehub.com/wp-admin/plugin-editor.php?file=MLMpercent2Fincludespercent2Fadminpercent2Fjspercent2Fblm.admin.ajax.js&plugin=MLMpercent2Fbinary-level-marketting.php
that is the javascript file
jQuery( doc ).prepared( operate( $ ) {
/**
* The file is enqueued from inc/admin/class-admin.php.
*/
$( ‘#nds_add_user_meta_ajax_form’ ).submit( operate( occasion ) {
occasion.preventDefault(); // Stop the default type submit.
// serialize the shape knowledge
var ajax_form_data = $("#nds_add_user_meta_ajax_form").serialize();
//add our personal ajax examine as X-Requested-With just isn't at all times dependable
ajax_form_data = ajax_form_data+'&ajaxrequest=true&submit=Submit+Kind';
console.log(ajax_form_data);
$.ajax({
url: params.ajaxurl, // area/wp-admin/admin-ajax.php
kind: 'put up',
knowledge: ajax_form_data
})
.completed( operate( response ) { // response from the PHP motion
$(" #nds_form_feedback ").html( "<h2>The request was successful </h2><br>" + response );
})
// one thing went mistaken
.fail( operate() {
$(" #nds_form_feedback ").html( "<h2>Something went wrong.</h2><br>" );
})
// in any case this time?
.at all times( operate() {
occasion.goal.reset();
});
});
});
that is the response operate
operate save_member_ajax () {
//ajax processing
if( isset( $_POST['ajaxrequest'] ) && $_POST['ajaxrequest'] === 'true' ) {
// server response
echo '<pre>';
print_r( $_POST );
echo '</pre>';
$mb = new Member();
$mb->setMemid($_POST['memid']);
$mb->setParent_ID($_POST["parentid"]);
$mb->setUsername($_POST["username"]);
$mb->setPassword($_POST["password"]);
$mb->setFirstname($_POST["firstname"]);
$mb->setLastname($_POST["lastname"]);
$mb->setOptgender($_POST["gender"]);
$mb->setBirthdate($_POST["birthdate"]);
$mb->setAddress($_POST["address"]);
$mb->setCity($_POST["city"]);
$mb->setState($_POST["state"]);
$mb->setCountry($_POST["country"]);
$mb->setPincode($_POST["pincode"]);
$mb->setMobile($_POST["mobile"]);
$mb->setEmail($_POST["email"]);
$mb->setImage($_POST["image"]);
$mb->setACC_FLAG($_POST["ACC_FLAG"]);
$mb->Insert();
wp_die();
}
that is the motion hook
$this->loader->add_action( 'wp_ajax_nds_form_response', $plugin_admin, 'save_member_ajax');
hope your helpful recommendations !!!