Hi.

I need to send a user to a form using a redirect, however, i will need to POST back the data they submitted. I am not able to just display the form on the script page.

Basically, I am creating a server side validation system, where there are a number of different forms. The plan was to redirect the users back to the page they came from with the data, plus a bit more for error checking, however if using the normal Header(Location🙂 redirect this would need to be done using GET, but post is needed as there is too much data.

As a last resort I will need to have every form contain it's own validation code, then use a POST request using cURL or something to submit the final/complete data to the current submission script (where I wanted the validtion code).

Any ideas?
Thanks!

    Sounds to me like you need to create a session and share the session variables with the different pages.

      The forms are on different servers.

        You can use javascript with html to accomplish this task.

        
        <script>
                function submitPost(url) {
                       //set the action page
                        form.submit.action = url;
                       // do the submit
                        form.submit();
                }
        </script>
        
        <form name="form" method=POST>
        <input type=hidden name=var1 value=val1 />
        </form>
        <script> submitPost('http://www.yoururl.com/page.php');</script>
        

        My JS is not that great, but if you get the syntax right that should do the trick

        http://javascript.internet.com
        http://www.webmonkey.com

        For help references.

        --FrosT

          I am using PHP because so many people have javascript off. When the site was first released a year or two ago, javascript was fine and errorneous entries were rare. Now however there are a noticeable number of errors that dont exist if javascript is turned on.

          Thanks.

            That is about all I know how to do it. I do not believe you can pass post data from site to site without doing a postback by a form button or with javascript.

            Maybe someone else has encountered this error, as for me that is the best I can give ya.

            --FrosT

              just a thought / question on this subject. --- would there be any reason why he could not write the information to a flat file and then have the server 2 call the information from that file on server 1. may be a idea for a workaround to accomplish it.

              ps --- i have never tried this so i dont know if it would even work or not...

                Write a Reply...