Frontend AJAX Media Upload returning 404

I can’t find the define of the ajaxurl variable. The 404 is inevitable. Usually, you need to define it in your function or directly in a wp_localize_script action. Dont’t forget to replace the wp_ajax_pn_reg_vendors, to make it work, even the user is not yet connect.

WordPress 403 error on form submission with Ajax

the issue was to do with cookies. In a multi-site setup, the cookies that are set upon user login depends on which subsite the user logged in from; not all cookies give equal authority to submit forms. so the solution is either you (a) change your cookie domain to one common one in wp_config.php – … Read more

How to return a record from a custom table by sending an AJAX request

Your code (both client-side and server-side) makes no sense and is very ugly. You’re not loading WordPress in your custom PHP script, so there’s no way $wpdb would work. To call a method of an object, you should do $wpdb->get_results(‘… sql …’). You shouldn’t call PHP scripts directly anyway. It’s better to create a REST … Read more