Hello,

Just rolling around with what seems like it should be a simple problem. I have a form with several user inputs and, then a Paypal submit button to process payments. I want to use the Paypal button to send the formmail and, then redirect to the appropriate Paypal page. Paypal's submit button is basically a form with a bunch of hidden fields and a form action.

I cannot get the two to work together. The best progress I've had is getting all the hidden fields sent via the formmail. Not really progess.

Anybody know exactly how I would do this?

Thanks!

    Originally posted by TomJones
    Hello,

    Just rolling around with what seems like it should be a simple problem. I have a form with several user inputs and, then a Paypal submit button to process payments. I want to use the Paypal button to send the formmail and, then redirect to the appropriate Paypal page. Paypal's submit button is basically a form with a bunch of hidden fields and a form action.

    I cannot get the two to work together. The best progress I've had is getting all the hidden fields sent via the formmail. Not really progess.

    Anybody know exactly how I would do this?

    Thanks!

    Not exactly...I suppose one could create a page which accepted the hidden form fields, sent a mail using them, re-echoed the fields in a form tag, then sent the browser to that location....but I guess that's the problem anyway, isn't it.

    Hmm, what about using Javascript to call a PHP popup that sent the mail and submitted the form....

    I dunno, really, lots of ideas, no experience doing exactly what you want. Hope something strikes a chord with you 🙂

      Uh oh,

      Not more stuff I'm even less clued in on. I've used js behaviors/events in several different ways but, nothing much beyond the standard stuff. Is what you are thinking easily accomplished?

      I'm down for trying if you can point me in a direction. I've only been thinking of using PHP without any other considerations. Maybe there is an easier way with js. Wish I knew more about it. Thanks for the idea!

        Put wadever datas u want into 2 separate form ?

        and for the submit button, set it as "NONE" den apply javascript to it to send 2 forms together?

        something like
        <input type=none name=ahha value="click me" onCLick:javascript:boo();">;

        javascript src.
        boo() {
        document.formname.submit();
        document.formname2.submit();
        }

        that simple, if i am pressuming wad I am thinking is wad u want

          I'll give that a try. The Paypal button is a formaction/redirect, I don't know if that makes it different from the standard "submit." Here it goes.....Thanks for the suggestion

            I have said it a million times not, DO NOT RELY ON JAVASCRIPT FOR IMPORTANT INFORMATION.

            Not to mention the fact that any 13 year old kid could come in and wreck havok.

            To submit to both paypal AND your site's purchase processing system:

            Paypal supports a post-back or data return ability that lets your script know if the payment succeeded, amount paid, ect. Use cURL or fsock to submit the form data to paypal, get the response, and then take the appropriate action based on the result.

            Not only does this mean the you can control every aspect of the payment process, and they will never leave your site or see a paypal logo, it also means that every payment will come from your server host/ip and you may use that as a security feature. ( IE: Did this payment come from my server? No?! Cancel Transaction. )

              It's funny you said that. I was just pondering what would happen if the user doesn't have Java enabled. Since it's a cornerstone of the site to be able to accept Paypal, it would be very detrimental. (didn't even know that js was easily hacked)

              This sounds like a promising direction, I'll start checking it right now.....

                Check with paypals' developer documentation, they are very detailed on these things. I think they may even offer examples.

                  Write a Reply...