-1

I would like to check customer's username after they have paid in paypal system (IPN). And I found the solution. That's PayPal button sending custom variable through IPN. This is my code that I've added in paypal button:

<input type="hidden" name="custom" value="<?=$username;?>">

This's all my paypal code in DB.

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="custom" value="<?=$username; ?>">
<input type="hidden" name="hosted_button_id" value="QY9G6XCJ9W7XX">
<table>
<tr><td><input type="hidden" name="on0" value="Type">Type</td></tr><tr><td><select name="os0">
    <option value="normal">normal $100.00 USD</option>
    <option value="earlybird">earlybird $200.00 USD</option>
    <option value="alumni">alumni ฿$00.00 USD</option>
</select> </td></tr>
</table>
<input type="hidden" name="currency_code" value="USD">
<input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>

This is return custom field value:

<?=$username;?>

It still be variable not my value.

This is paypal code in view page (query paypalcode from DB)

<?=$row->paypal_button;?>

I used paypal hosted button that create from paypal webpage.

Thank you in advance.

user43755
  • 1
  • 3

1 Answers1

0

This this instead.

<?php echo $username; ?>

It could be that your server isn't processing PHP short tags. Of course, this assumes that $username has a value set prior to this and it's available.

Drew Angell
  • 25,968
  • 5
  • 32
  • 51
  • I already tried it. But It's not work. Now It's work if I use JS like this `` – user43755 Jan 25 '15 at 07:55
  • I think it's problem about echo in echo. But I didn't know how to resolve. – user43755 Jan 25 '15 at 07:59