Need to capture and save to db when paypal button clicked

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mikelindsey
    New Member
    • Nov 2008
    • 2

    Need to capture and save to db when paypal button clicked

    Hello,
    I have standard Paypal "Add to Cart" buttons.
    I don't have a shopping cart on my site I use
    the Paypal shopping cart.

    I'd like to track when a user clicks on the "Add to Cart"
    and save that info to a database.

    I'm proficient at ASP coding but not sure
    how to handle this.

    I was thinking about sending the paypal form fields to another
    asp page when the user clicks the "add to cart" button,
    updating the db, then create another form in code and submit
    to paypal.

    I don't know if it's possible to submit a form in
    code on the server.

    Any suggestions are appreciated!
  • DrBunchman
    Recognized Expert Contributor
    • Jan 2008
    • 979

    #2
    Hi Mike,

    It is possible to submit a form using javascript which you could fire in the OnLoad event of your html body tag after your asp code has updated the db. The javascript is:

    Code:
    FormName.submit();
    You'd need to pass all of your variables on in the same way that you received them i.e. through the querystring or as hidden variables through the form.

    Hope this helps,

    Dr B

    Comment

    • jhardman
      Recognized Expert Specialist
      • Jan 2007
      • 3405

      #3
      I was thinking paypal used querystring data, in which case it would be very easy to redirect from code.

      Jared

      Comment

      • DrBunchman
        Recognized Expert Contributor
        • Jan 2008
        • 979

        #4
        Yes, in that case after you've updated your db you could just use:

        Code:
        Response.Redirect "www.paypal.com?a=1&b=2" etc
        Dr B

        Comment

        Working...