2017-06-30 7 views
0

オーケーと他の隠されたものにフォーム、説明多分よくないが、私はこれがあります。ペイパル

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"> 
 
<input type="hidden" name="cmd" value="_xclick"> 
 
<input type="hidden" name="business" value="<?php echo $output['Private']; ?>"> 
 
<input type="hidden" name="return" value="http://MYWEBSITE/index.php?code=succes&bruh=<?php echo $userid; ?>&money="> 
 
<input type="hidden" name="lc" value="US"> 
 
<input type="hidden" name="item_name" value="Topup"> 
 
<input type="hidden" name="currency_code" value="USD"> 
 
<input type="hidden" name="button_subtype" value="services"> 
 
<input type="hidden" name="no_note" value="0"> 
 
<input type="hidden" name="bn" value="PP-BuyNowBF:Buy%20Now%20Button.png:NonHostedGuest"> 
 
<table> 
 
<tbody><tr><td><input type="hidden" name="on0" value="TopUp_amounth">How much?</td></tr><tr><td><input type="text" name="amount" maxlength="200">$</td></tr> 
 
</tbody></table> 
 
<input type="submit" value="Top Up" name="submit"> 
 
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1"> 
 
</form>

を今、私は、彼らがに「TopUp_amounth」を挿入ものを得るための方法をしたいです戻りURL。 TopUp_amount人は、自分で選択することができます。しかし、私はそれが帰りに行くことを望むurlに。これはどうすればいいですか?

答えて

0

あなたがあなた自身のPHPスクリプトに送信し、このようcurl

であなたのorginalのリンク(ペイパル)にそれを敗走できます

if(isset($_POST['cmd'])){ 
$url = 'https://www.paypal.com/cgi-bin/webscr'; 
$fields = array(
    'cmd' => urlencode($_POST['cmd']), 
    'business' => urlencode($_POST['business']), 
    'return' => urlencode($_POST['return']), 
    [...] 
); 

//url-ify the data for the POST 
foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } 
rtrim($fields_string, '&'); 

//open connection 
$ch = curl_init(); 

//set the url, number of POST vars, POST data 
curl_setopt($ch,CURLOPT_URL, $url); 
curl_setopt($ch,CURLOPT_POST, count($fields)); 
curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string); 

//execute post 
$result = curl_exec($ch); 

//close connection 
curl_close($ch); 
} 

そして、あなたのHTMLフォーム:

<form action="#" method="post" target="_top"> 
your form 
</form> 
関連する問題