Hello, I have a text field for item_name and I'm wanting to have it be an option field.

If they DON'T type in anything, I'd like it to say 'Believers Center of Albuquerque Recurring Giving' If they DO type in anything, I'd like it to say 'Believers Center of Albuquerque Recurring Giving - (whatever they type)'

So I want to concatenate the text field to the end of the item name if they put something in there.

Any ideas?

Thanks! - David

1 answer

0
points

Just use a PHP script to modify the value of the "item_name" POST variable before it's sent to the paypal handling script like this:

if(isset($_POST['item_name'])) {
$startwith = 'Believers Center of Albuquerque Recurring Giving - ';
$_POST['item_name'] = $startwith.str_replace($startwith,"",$_POST['item_name']);
}
Answered over 6 years ago by Gary Hepting
  • Note: you will have to use a PHP script to handle the initial PayPal form instead of sending the POST data to PayPal directly (hint, the action="" of the <form>) Gary Hepting over 6 years ago
  • After you've processed the values accordingly, you can use PHP to generate the new POST data and continue passing that to PayPal Gary Hepting over 6 years ago