Jump to content

Another simple problem


rn14

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.