Welcome to WebmasterWorld Guest from

Forum Moderators: buckworks

Message Too Old, No Replies

pass amount by hidden input



10:31 am on Mar 1, 2013 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

I have the user to fill in the amount, however that gives problems as they cant fill in the right side before filling in the amount, and some does not see paypals error.

So I want to prefill the amount in with the value in a var.
It does not work, and I read that it does not work on hosted buttons, so this

<input type="hidden" name="cmd" value="_s-xclick">

needs to be changed to

<input type="hidden" name="cmd" value="_xclick">

The first encrypts the data sent by the form.

I sort of prefer the hosted button as that is safer and the button is encrypted.

Is there anyway to pass the value of amount dynamically using there hosted buttons?

I had a look at encrypting the button myself, but looks to complicated to me.
Any ideas.


1:02 pm on Mar 3, 2013 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

Well I found out, that I need to encrypt the form myself, wich is not as easy, being 2 days, got the certificates with openSSL and everything, however the rest....
I found this in another forum, but I just cant understand how to implent it, and how it can work:
You don't have to encrypt. Simply take the 'custom' variable, and, among other things you might need to put in there, add a hash of the price and product number, like so:

$sCustom .= '|' . md5($sSalt . $sProduct . $sPrice);

Then, when the IPN is processed, ensure that this hash was not disturbed with what is received back. If it was, then block the transaction."


2:37 pm on Mar 3, 2013 (gmt 0)

WebmasterWorld Senior Member lorax is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

Have you looked at the MD5 examples here: [php.net...]

Featured Threads

Hot Threads This Week

Hot Threads This Month