0

Hi All,

The form below is set to pass data to paypal, however I cant seem to get it to work when using variables recieved from a $_POST.

I get an error from paypal stating........

"The link you have used to enter the PayPal system contains an incorrectly formatted item amount."

all im trying to pass through is a variable 1.

Any advice would be appreciated.

Cheers

Paul

<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post"> 
<input type="hidden" name="cmd" value="_cart"> 
<input type="hidden" name="business" value="email@email.com"> 
<input type="hidden" name="add" value="1"> 
<input type="hidden" name="item_name" value="test"> 
<input type="hidden" name="item_number" value="1">
<input type="hidden" name="amount" value="<?php echo $price ?>"> 
<input type="image" src="https://www.paypal.com/images/x-click-but22.gif" border="0" name="submit" alt="Make payments with PayPal - it’s fast, free and secure!"> 
</form>
2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by whiteyoh
0

I could be wrong as my php is not that strong, but your echo statement looks incorrect

try <?php echo($price); ?>

Also are you setting the value of $price? i.e. you're not sending a null value are you?

0

Hi Thanks for the response.

I found the issue. My own stupid fault. I have a habit of concatenating line breaks, so when i was passing what i thought was 1, it was actually 1<br>

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.