5 Replies Latest reply on Feb 1, 2007 1:48 PM by Newsgroup_User

    Posting Form to Another Server

    dempster Level 1
      I'm trying to do the following:

      1. Users enter their username and password into a form on my server
      2. Form submits to a CF page that checks username and determines which web mail server user is on
      3. CF page then submits username/password to the web mail server so user is logged in

      This would not work using CFHTTP since I want the user's browser to log in and get the response (not the server). I believe it would also not work using CFLOCATION because I need to use post and not get for the form.

      I know I can do this by returning a page with the appropriate form fields and then using JavaScript to submit to the server. Is there another option available that does not use JavaScript?

      Thanks.
        • 1. Re: Posting Form to Another Server
          Level 7
          I know I can do this by returning a page with the appropriate form
          fields and then using JavaScript to submit to the server. Is there
          another option available that does not use JavaScript?

          Just the ones you have already dismissed. If you want the browser to do
          this, you have to send a request to the browser. There is no way you
          can not have the server do this for the browser.

          You can have the server do this and send the results to the browser, but
          this is the options you have dismissed.


          • 2. Re: Posting Form to Another Server
            mvierow
            Once the form is submitted and you have confirmed that the information entered is correct, display another form with the username and password in hidden form fields, named appropriately to match the webmail login form. The action of that form should also match the action of the webmail login form. Then add something like <body onload="document.form[0].submit()"> and you will forward the user to the webmail app, submitting the username and password just as if they did it normally, with the exception that the referrer will not be correct. Hopefully the app doesn't check for that.

            You should consider putting a submit button on that page however, just in case the user has javascript disabled otherwise they could be left in limbo. Place the button inside a <noscript> block so that it's only displayed to these users. That will give you the most seemless appearance.
            • 3. Posting Form to Another Server
              mvierow Level 1
              sigh.. sorry Ian, that's the second time I've done that. Not trying to rewrite your thoughts, you've managed to reply to two threads at the same time I'm typing I think.

              edit: well, now that I actually read the posts, I see my issue.. clearly my lunch hour has gone for to long.
              • 4. Re: Posting Form to Another Server
                Level 7
                sigh.. sorry Ian, that's the second time I've done that. Not trying to
                rewrite your thoughts, you've managed to reply to two threads at the
                same time I'm typing I think.

                Not a problem. More likely it is the delay in the system for us
                newsreader users. Our replies may not show up in the web forum for 15
                to 30 minutes after we send them according to the newsgroup FAQ.
                • 5. Re: Posting Form to Another Server
                  Level 7
                  Not trying to rewrite your thoughts,...

                  Actually I would not have minded if you could have rewritten this one:
                  "There is no way you can not have the server do this for the browser."

                  That is not my best composed sentence. I believe I wanted to say
                  something like:
                  "There is no way you can have the server do this for the browser."