html - customizing paypal checkout, including php variable -


i'm trying add "custom" value 3rd party checkout paypal option. problem i'm having php variable being displayed on screen. i'm passing shopping cart values in session variable.

if(isset($_session['checkout'])){ $orderdata = '<table border="1"><th style="width:80px">item</th>              <th sytle="width:250px">size</th>              <th style="width:60px">quantity</th>'; ($i=0; $i<count($_session['checkout']); $i++){     $orderdata .= '<tr><td style="text-align:center">'.$_session['checkout'][$i][0].'</td><td style="text-align:center">'.$_session['checkout'][$i][1].'</td><td style="text-align:center">'.$_session['checkout'][$i][2].'</td></tr>'; } } 

i want table passed along, , based on paypal documentation, need include it. i'm echoing out paypal form this:

echo '<form>       //other hidden values       <input type="hidden" name="custom" value="'.$orderdata.'">       //input submit button here       </form> 

and said, input supposed hidden, gets displayed before paypal button. how come?

update: code passes amount perfectly:

<input type="hidden" name="amount" value="';?><?php if(isset($_session['disc'])){print_r($_session['disc']);}?><?php echo '"> 

it doesn't display on page variable amount correct in page source.

update2: here's entire cart script:

echo '<div style="position:absolute; left:770px; top:50px"> <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="business" value="myemail@example.com"> <input type="hidden" name="item_name" value="merchandise"> <input type="hidden" name="currency_code" value="usd"> <input type="hidden" name="no_shipping" value="0"> <input type="hidden" name="custom" value="'.$orderdata.'"> <input type="hidden" name="return" value="backtomywebsite.com"> <input type="hidden" name="cancel_return" value="backtomywebsite.com"> <input type="hidden" name="amount" value="';?><?php if(isset($_session[$disc])){print_r($_session[$disc]);}?><?php echo '"> <input type="image" src="http://www.mywebsite.com/images/buynow.png" name="submit" alt="make payments paypal - it\'s fast, free , secure!" width="300" height="204">     </form>     </div>'; 

the script works when instead of $orderdata have print_r session item information. information gets sent paypal account in array form , looks ugly. if there way make (member information, order information) php variable , pass custom field, great. anyway...here's on screen:

image showing paypal text

hope you're still willing me out.

what mean gets displayed before paypal button? if viewing source code of page, see value in page.

if saying passing amount over, not seeing may using wrong variable. variable amount valid paypal variable depending button using amount varialbe different. not tell code didn't see passing on "cmd", if using buy button or add cart button variable "amount" correct variable use. if usnig cart upload method, want use variable "amount_x". if passed 2 items over, , first 1 0.99 , second 1.99 pass on variable/value of "amount_1=0.99" , "amount_2=1.99".


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -