<?php

require_once("config.php");

?>

<form method="post" name="paypal_form" action="https://www.paypal.com/cgi-bin/webscr">

    <input type="hidden" name="cmd" value="_cart" />
    <input type="hidden" name="business" value="<?php echo($receiver_email); ?>" />
    <input type="hidden" name="currency_code" value="<?php echo($mc_currency); ?>" />
    <input type="hidden" name="no_note" value="1" />
    <input type="hidden" name="upload" value="1" />


    <!-- //language code, France(FR), Spain (ES), Italy (IT), Germany (DE), China (CN), English (US). -->
    <input type="hidden" name="lc" value="US" />
    
    <!-- Cart Product Information -->
    <?php        
    for ($i = 0; $i < count($products); $i++) {
        ?>
        <input type="hidden" name="item_name_<?php echo ($i+1) ;?>" value="<?php echo($products[$i][0]); ?>" />
        <input type="hidden" name="amount_<?php echo ($i+1) ;?>" value="<?php echo($products[$i][1]); ?>" />
        <input type="hidden" name="item_number_<?php echo ($i+1) ;?>" value="<?php echo($products[$i][2]); ?>" />
        <input type="hidden" name="quantity_<?php echo ($i+1) ;?>" value="<?php echo($products[$i][3]); ?>" />
        <input type="hidden" name="shipping_<?php echo ($i+1) ;?>" value="<?php echo($products[$i][4]); ?>" />
        <?php
    }
    ?>

    <!-- URLs -->
    <?php
        if ($notify_url != "") {
        ?>
            <input type="hidden" name="notify_url" value="<?php echo($notify_url); ?>" />
        <?php
        }
        ?>

        <?php
        if ($cancel_url != "") {
        ?>
            <input type="hidden" name="cancel_return" value="<?php echo($cancel_url); ?>" />
        <?php
        }
        ?>
        
        <?php
        if ($return_url != "") {
        ?>	
            <input type="hidden" name="return" value="<?php echo($return_url); ?>" />
        <?php	
        }

    ?>

    <input type="submit" name="submit" value="Make Purchase" />

</form>

<?php

?>
