I need to link paypal and forms

Discussion in 'PHP' started by Coopzie, Feb 22, 2011.

  1. #1
    What I want is two forms,

    When you select the first, the data in the 2nd form is linked from the first selected, example;


    Form 1 - Select Course
    Form 2 - Available Course Dates (linked to the selected course)
    Price: - Course Price (linked to the selected course)

    Paypal Button - Pay Now

    So Course 1 could have an April and May
    Course 2 = September and January
    and so on.

    So when they pay with paypal, the data from the two forms and price are in paypal also, I think I could setup the paypal button to have the price anyway, but its linking the two forms togethe that I am having issues with,

    Where do I start?

    Do I need php and mysql?
    or could it be done through html?
     
    Coopzie, Feb 22, 2011 IP
  2. interwho

    interwho Member

    Messages:
    198
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    30
    #2
    You could try passing the first form through a php form processer, and then create the applicable pay now link through the following Pay Now code:

        <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
          <input name="cmd" type="hidden" id="cmd" value="_cart">
          <input name="business" type="hidden" id="business" value="BUSINESS EMAIL">
          <font face="Arial" color="#000000"><small> </small> <small> </small> </font><font size="2" face="Arial"> 
          </font><font color="#000000" face="Arial"><small> </small> <small> </small> 
          <small> </small> <small> </small> <small> </small> <small> </small></font><font color="#000000"><small> 
          </small></font><font color="#000000" face="Arial"><small> </small> <small>
          <input type="hidden" name="item_name" value="ITEM NAME">
          </small> <small> </small></font><font color="#000000"><small> </small></font><font color="#000000" face="Arial"><small> 
          </small> <small> </small> <small> </small> <small> </small> <small> </small> 
          <small> </small></font><font size="2" face="Arial"> </font><font face="Arial" color="#000000"> 
          <small> </small> <small> </small></font> 
          <input name="amount" type="hidden" id="amount" value="COST">
          <input name="return" type="hidden" id="return" value="RETURN URL">
          <input name="currency_code" type="hidden" id="currency_code" value="USD">
          <input name="lc" type="hidden" id="lc" value="US">
          <input name="submit" type="image" id="submit" src="http://www.paypal.com/en_US/i/btn/sc-but-03.gif" alt="Make payments with PayPal - it's fast, free and secure!" border="0">
          <input name="add" type="hidden" id="add" value="1">
          <strong><font color="#0000FF" face="Verdana"><br>
          <br>
          Only: COST</font></strong> 
        </form>
    HTML:
    .

    That should work nicely.
     
    interwho, Feb 22, 2011 IP