我最近剛剛做到了這一點,
將您的貝寶自定義字段按照您的願望發送到數據中,在該自定義字段中使用分隔符來分割數據。 在下面的例子中,值使用「|」分開,您可以使用字符集中需要的任何字符。
$member_id = 1;
$some_other_id = 2;
<input type="hidden" name="custom" value="<?php echo $member_id.'|'.$some_other_id ?>"/>
這將輸出:
<input type="hidden" name="custom" value="1|2"/>
當你收到來自PayPal(IPN的響應)過程中它像這樣的信息:
$ids = explode('|', $_POST['custom']); // Split up our string by '|'
// Now $ids is an array containing your 2 values in the order you put them.
$member_id = $ids[0]; // Our member id was the first value in the hidden custom field
$some_other_ud = $ids[1]; // some_other_id was the second value in our string.
因此,基本上,我們發送一個字符串我們選擇貝寶的自定義分隔符,貝寶將在IPN響應中將其返回給我們。然後我們需要分解它(使用explode()函數),然後按照你的意願去做。
當您選擇它使用普通方法從數據庫中獲取你的價值,那麼就由1減使用它:
$val_from_db--; // Thats it!, Takes the current number, and minus 1 from it.
找到了這一位代碼.. – user718359
$ temp = $ _POST ['custom']; //&和IP&visitorId&attributionInfo 列表($ ,$ ,$ custIP,$ visitorId,$ attributionInfo)=爆炸( 「&」,$溫度,5); –
user718359