SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Addict
    Join Date
    Feb 2004
    Posts
    291
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    PHP-code on POST?

    On my site is a registration form where users can signup. But the thing is that the <form> POSTs to another site where the details then are stored.

    I would like to log in a table when users click on the "submit"-button. Is there any way to do this? Where do I place the PHP-code?

    (I think the problem lies in the fact that the form POSTs to another site.........I can not figure this out )

  2. #2
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,629
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Why do you have YOUR form posting to ANOTHER site?
    Ian Anderson
    www.siteguru.co.uk

  3. #3
    SitePoint Guru babyboy808's Avatar
    Join Date
    Nov 2004
    Location
    dublin
    Posts
    602
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    make the form point to a new script on you server... and create the script...

  4. #4
    SitePoint Addict
    Join Date
    Feb 2004
    Posts
    291
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thx for your replies.

    I need to post to another site, because that company will then give the user the option to make an online-payment. My site does not have this option.

    If I make the form point to a new script on my server, can I then afterwards the variables are stored in my database, program a POST to the other site?

  5. #5
    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)
    Can you send them to the other address by redirecting to a URL with the variables in the query string? This is how you'd do it with PayPal, the same type of setup you're talking about.

    POST to your own forum, record the information you want to record, construct the payment URL and use header() to do an immediate redirect there.

  6. #6
    SitePoint Addict
    Join Date
    Feb 2004
    Posts
    291
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thx Dan.

    This solution was also what I was thinking about. But the other site requires that I POST the variables, because GET is considered to be unsafe.

  7. #7
    SitePoint Wizard bronze trophy Immerse's Avatar
    Join Date
    Mar 2006
    Location
    Netherlands
    Posts
    1,661
    Mentioned
    7 Post(s)
    Tagged
    1 Thread(s)
    Then you could possibly use cURL to construct and carry out the post to the remote site. The cURL libraries are very handy for that kind of thing

  8. #8
    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)
    The 3rd party processor probably doesn't want, and may prohibit through terms/contract, having his server posting as a user to the payment form. It poses some fraud detection problems for them, not having the real user making the POSTs from his own IP to start payment on their site.


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
  •