SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Jul 2003
    Location
    uk
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question How do I parse e-gold form into mysql?

    I am setting up a website to accept e-gold payments. I need some PHP script that will read the form url sent to my server by e-gold and then input the data into mysql database on my server.

    Anyone got the answer.

    Thanks.

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Got an example of this form? Trying to figure out exactly what you need.

  3. #3
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if a url is passed, say...

    www.domain.com/index.php?var1=1&var2=2&var3=3

    all of these variables are accessible via the $_GET array.


    So $var1 = $_GET['var1'], etc.

    Then you could do
    PHP Code:
    mysql_query("INSERT INTO table SET field1 = $var1,  field2 = $var2$field3 = $var3"); 
    Does that help?

    Aaron
    Aaron Brazell
    Technosailor



  4. #4
    SitePoint Member
    Join Date
    Jul 2003
    Location
    uk
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    below is an example of the e-gold form
    the STATUS_URL is the one e-gold's server sends to my server.

    I am just learning php & mysql, so I am not fully conversant with it all at the
    moment.

    Any help would be appreciated.

    <form action="https://www.e-gold.com/sci_asp/payments.asp" method="POST">
    <p>
    <input type="hidden" name="PAYEE_ACCOUNT" value="900123">
    <input type="hidden" name="PAYEE_NAME" value="High Tech Widgets">
    <input type="hidden" name="PAYMENT_AMOUNT" value="109.99">
    <input type="hidden" name="PAYMENT_UNITS" value="1">
    <input type="hidden" name="PAYMENT_METAL_ID" value="1">
    <input type="hidden" name="STATUS_URL"
    value="https://www.high-tech.com/cgi-bin/xact.exe">
    <input type="hidden" name="PAYMENT_URL"
    value="https://www.high-tech.com/cgi-bin/chkout1.exe">
    <input type="hidden" name="NOPAYMENT_URL"
    value="https://www.high-tech.com/cgi-bin/chkout2.exe">
    <input type="hidden" name="BAGGAGE_FIELDS"
    value="ORDER_NUM CUST_NUM">
    <input type=”hidden” name=”ORDER_NUM” value=”9801121”>
    <input type=”hidden” name=”CUST_NUM” value=”2067609”>
    <input type="submit" name="PAYMENT_METHOD" value="e-gold account">
    </p>
    </form>

    <form method="POST">
    <p align="center"><input type="submit" name="CANCEL"
    value="CANCEL"></p>
    </form>
    </body>
    </html>

  5. #5
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Those variables are not passed viat the URL. They are passed via POST. Try this.
    PHP Code:
    <?php
    @extract($_POST);
    $sql mysql_query("INSERT INTO table SET
    PAYEE_ACCOUNT = 
    $PAYEE_ACCOUNT,
    PAYEE_NAME = '
    $PAYEE_NAME',
    PAYEEE_AMOUNT = '
    $PAYEE_AMOUNT',
    PAYMENT_UNITS = '
    $PAYEE_UNITS',
    PAYMENT_METAL_ID = '
    $PAYMENT_METAL_ID',
    STATUS_URL = '
    $STATUS_URL',
    PAYMENT_URL = '
    $PAYMENT_URL',
    NOPAYMENT_URL = '
    $NOPAYMENT_URL',
    BAGGAGE_FIELDS = '
    $BAGGAGE_FIELDS',
    ORDER_NUM = '
    $ORDER_NUM',
    CUT_NUM = '
    $CUST_NUM',
    PAYMENT_METHOD = 'PAYMENT_METHOD'"
    )
      or die(
    mysql_error());
    echo 
    'Query executed Successfully';
    ?>
    Of course you'd have to create the table ni MySQL first with those fields.

    Aaron
    Aaron Brazell
    Technosailor



  6. #6
    SitePoint Member
    Join Date
    Jul 2003
    Location
    uk
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks a lot for your help I will put this code in and let you know the outcome, as soon as I have completed the mysql setup.


Bookmarks

Posting Permissions

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