Ok, this is for every one you can prevent data save in Inspect Element....this work 100000% work.
This is very helpful for online shoping
Now you can put jQuery code after your Form.
Like this
$output = '<form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="' . $paypalID . '">
<input type="hidden" name="return" value="' . $return_url . '">
<input type="hidden" name="currency_code" value="' . $currency . '">
<input type="hidden" name="item_name" value="' . $product_name . '">
<input type="hidden" name="amount" id="p'.$product_id.'" value="' . $product_price . '">
<input name="notify_url" value="' . plugin_dir_url(__FILE__) . 'ipn.php" type="hidden">
<input type="image" src="' . $upload_image . '" border="0" name="submit" alt="Make payments with PayPal - its fast, free and secure!">
</form>';
$output .= "<script>
jQuery(document).ready(function(){
var a=".$product_price.";
jQuery('form[name=_xclick]').submit(function(c){
var b=jQuery('input[id=p".$product_id."]').val();
if(b==a){
return
}else{
c.preventDefault()
}
})
});
</script>";
return $output;
First we make an id in price text field.
We save price from DB in jQuery.
Then we call a form on submit save a value of amount text field.
Then we check if DB value and amount value is same then it proceed else it stop.
if any on can change the value of amount in inspect element, then the form is not submited.
Hope this will help you.
But you should know that, using this method, a determined attacker could still change your prices, even though joe user might not be able to inspect element. So a better option would be to only submit the product id and use a server side process to communicate with PayPal.