所以我将自定义值传递给PayPal:
<input type="hidden" name="custom" value="<?php echo $id; ?>">
然而,当它返回自定义变量时,它有时会将其返回为:
其中:custom =%3C%3Fphp + echo + 9445%3B +%3F%3E
或者这个:2。custom = 9445
这是随机的。有时它会正确返回(自定义= 9445),有时会将其返回为%3C%3Fphp + echo + 9445%3B +%3F%3E。在存储到数据库中并将其与特定用户相关联时,会混淆其他功能。我错过了什么吗?我做错了吗?
完整表单代码:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="XXXXXXXXXX">
<input type="hidden" name="custom" value="<?php echo $id; ?>">
<input type="image" src="http://www.XXXXXX.com/XXX/XXXX/XXXXXX.png" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>