two actions on single form submit

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jeevik
    New Member
    • Aug 2007
    • 4

    two actions on single form submit

    hi everybody

    my form is posted to an 3rd party site on submit.. Now i want to store the textbox values in my database before posting the values to the 3rd party site..

    thanks in advance
  • nathj
    Recognized Expert Contributor
    • May 2007
    • 937

    #2
    Originally posted by jeevik
    hi everybody

    my form is posted to an 3rd party site on submit.. Now i want to store the textbox values in my database before posting the values to the 3rd party site..

    thanks in advance
    Hi jeevik,

    I don't think it's possible to have two actions on one form.

    Perhaps you couldpost the data to a page on your site, read the information in to your database (with all the uesual securoity checks) then forward the data on to the 3rd party via another, hidden form.

    I think the second form would have to submit itself somehow.

    Unfortunatley you are going to have come up with some sort of 'fudge' as one from = one actions.

    Cheers
    nathj

    Comment

    • ronnil
      Recognized Expert New Member
      • Jun 2007
      • 134

      #3
      it is actually possible to send post data from php. saw an example a couple of days ago... should have bookmarked it (damnit!) but i believe it was hidden in some library in the php manual link

      This is definately the way, unless you want to use ajax and then post to your own site upon submit

      Comment

      • Purple
        Recognized Expert Contributor
        • May 2007
        • 404

        #4
        Hi all,

        you could use javascript to trap the submit event, open a new window, make a call to a php script in the background to copy the data to the database and then process the submit of the initial form normally..

        Regards Purple

        Comment

        • Purple
          Recognized Expert Contributor
          • May 2007
          • 404

          #5
          Hey Ronnil,

          was it [PHP]HttpRequest::se tPostFields[/PHP] or [PHP]HttpRequest::se tRawPostData[/PHP] to set post data to be sent ?

          Regards Purple

          Comment

          • nathj
            Recognized Expert Contributor
            • May 2007
            • 937

            #6
            Not even my post and I'm learning loads.

            This place is great!

            nathj

            Comment

            • pbmods
              Recognized Expert Expert
              • Apr 2007
              • 5821

              #7
              Heya, Jeevik.

              You may find the last post in this thread useful.

              Comment

              • ak1dnar
                Recognized Expert Top Contributor
                • Jan 2007
                • 1584

                #8
                Originally posted by jeevik
                hi everybody

                my form is posted to an 3rd party site on submit.. Now i want to store the textbox values in my database before posting the values to the 3rd party site..

                thanks in advance
                another way of doing this is;
                Submit your form values to your own script which writes the form values to the database tables, Once completed task, print the collected form values again to another dynamic form. And for the body onload event of the page you can submit this form with values to the 3rd party website.

                Comment

                • jeevik
                  New Member
                  • Aug 2007
                  • 4

                  #9
                  thanks for all

                  i have got the solution ...

                  Comment

                  • pbmods
                    Recognized Expert Expert
                    • Apr 2007
                    • 5821

                    #10
                    Heya, Jeevik.

                    Glad to hear you got it working! Good luck with your project, and if you ever need anything, post back anytime :)

                    Comment

                    • heals1ic
                      New Member
                      • Sep 2007
                      • 1

                      #11
                      Can you post your solution if you have solved your issue.

                      Comment

                      • welkins
                        New Member
                        • Jan 2008
                        • 1

                        #12
                        Originally posted by jeevik
                        thanks for all

                        i have got the solution ...
                        A few other new users are faced with the same problem. Were you successful?

                        Any feedback is welcome, thanks

                        Comment

                        Working...