Hey guys,
I use a premade script to allow users of my site to buy virtual credits. The only problem is(as i found out yesterday) users are able to hack it.
The problem arises when users edit the hidden form data in the html and make it so they spend only 0.01 for something that is worth $5.00
Script basics:
Code:
<form method="post" name="paypal_form" action="https://www.paypal.com/cgi-bin/webscr">
<input type="hidden" name="rm" value="2"/>
<input type="hidden" name="cmd" value="_xclick"/>
<input type="hidden" name="business" value="eviltyd@hotmail.com"/>
<input type="hidden" name="return" value="http://www.ichumon.com/ichu_cash5k.php?action=success"/>
<input type="hidden" name="cancel_return" value="http://www.ichumon.com/ichu_cash5k.php?action=cancel"/>
<input type="hidden" name="notify_url" value="http://www.ichumon.com/ichu_cash5k.php?action=ipn"/>
<input type="hidden" name="item_name" value="50 IchuCash"/>
<input type="hidden" name="amount" value="5.00"/>
<input type="hidden" name="custom" value="1"/>
<center><br/><br/>If you are not automatically redirected to paypal within 5 seconds...<br/><br/>
<input type="submit" value="Click Here"></center>
</form>
this is the code they are editting. What i want to know is if there is a way to make sure that it only allows to send $5.00 for the amount. or for that matter, any of the other values. I don't know how to get them sent to paypal without forms but all forms can be editted :X
I am using the premade script : PHP Paypal IPN Integration Class Demonstration File
Any help on how to fix this? thanks!