jQuery forms & updating info

ahh nvm, sorted it: jQuery(document).ready(function($){ $(‘.addtocart’).submit(function(){ var data = {action: ‘my_special_action’,post:$(‘.addtocart’).serialize() }; $.post(“<?php echo admin_url(‘admin-ajax.php’); ?>”, data, function(response){ $(“.eshopajax”).insertAfter(this).fadeIn(100).html(response).fadeOut(3000); setTimeout (clearCart,200); setTimeout (doRequest,500); setTimeout (clearRequest,3000); }); function doRequest(){ var tdata = {action: ‘my_cart’}; $.post(“<?php echo admin_url(‘admin-ajax.php’); ?>”, tdata, function(response){ $(“.ajaxcart”).insertAfter(this).fadeIn(100).html(response); }); } function clearRequest(){ $(“.eshopajax”).empty(); } function clearCart(){ $(“.ajaxcart”).insert(); } return false; }); });

Best way to reset some admin options form to default?

You should (and must for security) use validation function, that is part of Settings API. I don’t seem to see it in your code. There you should be able to simply pass empty value for option under circumstances it should be saved as disabled. Of course you can also just use regular Options API functions … Read more

How to use multiple check-box values to work in a function and insert values in database

Currently you are passing on this value: ‘post_category’ => array(‘3,4,5’) // This is a single string While you should be doing this: ‘post_category’ => array(3,4,5) // Three separate values Don’t forget to sanitize the POST values neither: // Initialize categories $post_category = array(); // Prevent “undefined variable” error notices if (isset($_POST[‘vtype’])) { // Loop over … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)