how to echo hidden form fields based on conditional check boxes in php?
I want the form to echo the hidden form fields based on which check box is checked, note i need to echo the hidden form fields before the submit button is pressed, since it is going to paypal. Here is what i have so far -

    <?php		
    echo ('<form action="https://www.paypal.com/cgi-bin/webscr" method="post">');
    echo ('<input type="hidden" name="cmd" value="_cart">');
    echo ('<input type="hidden" name="upload" value="1">');
    echo ('<input type="hidden" name="business" value="youremail@mail.com">');
    echo ('<input type="hidden" name="currency_code" value="US">');	
    echo ('<input type="checkbox" name="camp1" value="a">');
    echo ('<input type="checkbox" name="camp2" value="b">');	

    if (isset($_POST['camp1'])) {

    echo ("<input type='hidden' name='item_name_1' value='beach ball'>");
    ("<input type='hidden' name='amount_1' value=50'>");
    }
    if (isset($_POST['camp2'])) {

    echo ("<input type='hidden' name='item_name_2' value='towel'>");
    ("<input type='hidden' name='amount_2' value='20'>");
    }
    echo ("<input type='submit' value='PayPal'>");
    ("</form>");
    ?>
I have also tried replacing 
    
    if (isset($_POST['camp1'])) {
with something like 
    
    if(IsChecked('camp1','a')) {

With no luck.

Any help would be much appreciated! 
how to echo hidden form fields based on conditional check boxes in php?
===

I want the form to echo the hidden form fields based on which check box is checked, note i need to echo the hidden form fields before the submit button is pressed, since it is going to paypal. Here is what i have so far -

    <?php		
    echo ('<form action="https://www.paypal.com/cgi-bin/webscr" method="post">');
    echo ('<input type="hidden" name="cmd" value="_cart">');
    echo ('<input type="hidden" name="upload" value="1">');
    echo ('<input type="hidden" name="business" value="youremail@mail.com">');
    echo ('<input type="hidden" name="currency_code" value="US">');	
    echo ('<input type="checkbox" name="camp1" value="a">');
    echo ('<input type="checkbox" name="camp2" value="b">');	

    if (isset($_POST['camp1'])) {

    echo ("<input type='hidden' name='item_name_1' value='beach ball'>");
    ("<input type='hidden' name='amount_1' value=50'>");
    }
    if (isset($_POST['camp2'])) {

    echo ("<input type='hidden' name='item_name_2' value='towel'>");
    ("<input type='hidden' name='amount_2' value='20'>");
    }
    echo ("<input type='submit' value='PayPal'>");
    ("</form>");
    ?>
I have also tried replacing 
    
    if (isset($_POST['camp1'])) {
with something like 
    
    if(IsChecked('camp1','a')) {

With no luck.

Any help would be much appreciated! 