Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jul 2007
    Location
    Scotland
    Posts
    134
    Thanks
    12
    Thanked 0 Times in 0 Posts

    submitting to paypal or other

    Hi Guys,

    on the site i am creating i have built nion it all, i am at the check out point, i ahve a form the user fills in with there credit card details, the next page i assume is the submission to the payment website i.e authorise.net for example, my question is how do i call the class? would i set the form action to:

    <form action="paypal.ipn.php" method="post">

    with the relevany hidden fields?

    heres a test page:

    payment.php

    PHP Code:
    <?php
    session_start
    ();

    include(
    "inc/dbconnection.php");
    include(
    "inc/online.php");
    include(
    "inc/header.php");
    include(
    "inc/navigation.php");
    ?>
    <?php
     
    // standard header //
     
    print("<div class=\"subheader\"><div id=\"title\">Home > <span class=\"blue\">Payment Methods</span></div>Select your payment method.</div>");
     
     
    // vars // 
     //$start_date = date('Y');
     //  $end_date = date('Y') + 10;
     
     // -- PAYMENT -- //
     
    print("<table width=\"80%\" border=\"0\" cellspacing=\"0\" cellpadding=\"6\" style=\"border:#d9dce2 1px solid;\">\n");
     print(
    "<tr>");
     print(
    "<td colspan=\"4\" bgcolor=\"#ecedf0\" align=\"left\"><b>Payment Methods [Credit or Debit Card]</b></td>");
     print(
    "</tr>");
     print(
    "<tr>");
     print(
    "<td colspan=\"2\" align=\"left\">Card Type</td><td align=\"left\"><select name=\"cc_type\"><option value=\"amex\">American Express</option><option value=\"visa\">Visa</option><option value=\"mastercard\">Mastercard</option><option value=\"switch\">Switch</option><option value=\"maestro\">Maestro</option></select></td>");
     print(
    "</tr>"); 
     print(
    "<tr>");
     print(
    "<td colspan=\"2\" align=\"left\">Card Number</td><td align=\"left\"><input type=\"text\" name=\"cc_number\" size=\"50\"></td>");
     print(
    "</tr>\n");
     print(
    "<tr>\n");
     print(
    "<td colspan=\"2\" align=\"left\">Card Expiration Date</td><td align=\"left\"><select name=”cc_exp_month”>
            <option value=””>Month</option>
            <option value=”1”>Jan</option>
            <option value=”2”>Feb</option>
            <option value=”3”>Mar</option>
            <option value=”4”>Apr</option>
            <option value=”5”>May</option>
            <option value=”6”>Jun</option>
            <option value=”7”>Jul</option>
            <option value=”8”>Aug</option>
            <option value=”9”>Sep</option>
            <option value=”10”>Oct</option>
            <option value=”11”>Nov</option>
            <option value=”12”>Dec</option>
            </select><select name=”cc_exp_year”>
            <option value=””>Year</option><option value=\"2008\">2008</option>"
    );
     print(
    "<option value=\"2009\">2009</option></select>");      
     print(
    "</select>\n");
     print(
    "</td>");
     print(
    "</tr>");
     print(
    "<tr>");
     print(
    "<td colspan=\"4\" align=\"right\" style=\"border-top:#d9dce2 1px solid;\" align=\"right\" colspan=\"2\"><input type=\"submit\" name=\"submit\" value=\"Charge My Account\"></td>");
     print(
    "</tr>");
     print(
    "</table>");
     
     print(
    "<br />");
     
    ?>
    <?php
    // include the footer //
    include("inc/footer.php");
    ?>
    thanks guys

    Graham

  • #2
    Regular Coder mlse's Avatar
    Join Date
    Mar 2005
    Posts
    624
    Thanks
    20
    Thanked 19 Times in 18 Posts
    Hi there,

    Firstly, I wonder why you are using print() to display what is essentially static HTML - you can just type it in outside the PHP tags, like you would in a bog standard HTML document.

    Secondly, I'm not really sure what you're asking - for example what do you mean by "calling the class"? What class? Where? Do you mean an instance of a PHP class?

    The usual way to submit data from input tags on a web page in a browser to a script on a server, you need to enclose the input tags within a <form> tag and set the form's action attribute to point to the script that you want to submit the form to.

    Also, with payment CGIs you tend not to gather the card information yourself, rather you set up a server-side redirect to the card processing company's card processing interface which you can sometimes customize yourself (this is dependent on the package you chose). This is all for security reasons.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •