开发者

paypal html api problem with displaying email with @?

开发者 https://www.devze.com 2022-12-25 04:04 出处:网络
whenever i send a form hidden field to paypal with an email as a field value containing @ eg. <input type=\"hidden\" name=\"email\" value=\"test@gmail.com\" />

whenever i send a form hidden field to paypal with an email as a field value containing @ eg.

<input type="hidden" name="email" value="test@gmail.com" />

it breaks the layout in the paypal page. if i remove the @ its ok.

i wonder maybe it helps if i use the html entity for @ (in the format &xxx;).

is there a html entity for @?

someone knows another solution to this or knows why it breaks the layout in paypal? (the password box beneath the email will be misplaced).

source code:

<form action='https://www.paypal.com/cgi-bin/webscr' method='post' id='payPalForm'>
<input type='hidden' name='cmd' value='_cart' />
<input type='hidden' name='upload' value='1' />
<input type='hidden' name='business' value='your@paypalaccount.com' />
<input type='hidden' name='tax_rate' value='25' />
<input type='h开发者_StackOverflowidden' name='currency_code' value='SEK' />
<input type='hidden' name='return' value='http://www.shop.com/order_confirmation' />
<input type='hidden' name='item_name_1' value='Apple Macpro' />
<input type='hidden' name='item_number_1' value='1 - Product 1' />
<input type='hidden' name='amount_1' value='25000' />
<input type='hidden' name='item_name_2' value='Apple Macbook Pro' />
<input type='hidden' name='item_number_2' value='2 - Product 2' />
<input type='hidden' name='amount_2' value='12000' />
<input type='hidden' name='item_name_3' value='Apple Macbook Air' />
<input type='hidden' name='item_number_3' value='3 - Product 3' />
<input type='hidden' name='amount_3' value='15000' />
<input type='hidden' name='item_name_4' value='PC' />

<input type='hidden' name='item_number_4' value='4 - Product 4' />
<input type='hidden' name='amount_4' value='2300' />
<input type='hidden' name='address1' value='Möllebogatan 19' />
<input type='hidden' name='address2' value='Von lingens Väg 4' />
<input type='hidden' name='city' value='Malmö' />
<input type='hidden' name='country' value='SE' />
<input type='hidden' name='first_name' value='Åke' />
<input type='hidden' name='last_name' value='Svensson' />
<input type='hidden' name='lc' value='SE' />
<input type='hidden' name='charset' value='utf-8' />
<input type='hidden' name='night_phone_a' value='08' />
<input type='hidden' name='night_phone_b' value='452438' />
<input type='hidden' name='state' value='Stockholms län' />
<input type='hidden' name='zip' value='029 23' />
<input type='hidden' name='email' value='hejsdsdsd@gmail.com' />
<input type='submit' name='Submit' value='Betala med PayPal' />
</form>

try to put this in a php document and click the link in the displayed page.

it will take you to the paypal page with a broken layout.

THEN remove the @ from the email and it works just fine!

the source code of the paypal page is very long. go to the page with my php source code and watch the source code in the web browser.


Are you useing urlencode()?

$email =urlencode($_POST['email']);

Here are some code examples that may help:
https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/library_download_sdks

0

精彩评论

暂无评论...
验证码 换一张
取 消