rn14 Posted February 13, 2007 Share Posted February 13, 2007 Im attempting to pass the total value of a shopping cart to paypal. Im certain the value is in the variable $amount (printed it on the previous line) however this isnt passed to the paypal page. badly need a solution to this!! function display_checkout_form() { ?> <? global $total_price; global $items; if(!$items) $items = "0"; if(!$total_price) $total_price = "0.00"; ?> <? if(session_is_registered("admin_user")) echo " "; else echo "<br>Total Items = $items<br>"; ?> </td> <td align = center rowspan = 2 width = 135> <? if(session_is_registered("admin_user")) display_button("logout.php", "log-out", "Log Out"); else // display_button("show_cart.php", "view-cart", "View Your Shopping Cart"); ?> </tr> <tr> <td align = center valign = top> <? if(session_is_registered("admin_user")) echo " "; else echo "Total Price = €".number_format($total_price); ?> <form action="https://www.paypal.com/ie/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="business" value=""> <input type="hidden" name="item_name" value=""> <input type="hidden" name="currency_code" value="EUR"> <?$amount = $total_price; echo $amount; ?> <input type="hidden" name="amount" value="<?$amount?>"> <input type="image" src="http://www.paypal.com/en_US/i/btn/x-click-but01.gif" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"> </form> Link to comment https://forums.phpfreaks.com/topic/38316-another-simple-problem/ Share on other sites More sharing options...
arianhojat Posted February 13, 2007 Share Posted February 13, 2007 <input type="hidden" name="amount" value="<?php echo $amount; ?>"> btw asp style tags <? ?> sometimes arent enalbed by default on server if u set up your own php server. anyway use <?php ?> more portable Link to comment https://forums.phpfreaks.com/topic/38316-another-simple-problem/#findComment-183635 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.