Form & CGI POST
-
When you post variables to a server via a FORM you normally do...
Once that form is submitted either directly through someone clicking on a submit button or indirectly via a function call to submit() when using PHP or ASP why does the URL always change to reflect the script that just got called? Perl doesn't appear to require you to do this. It let's you POST and no page refreshing seems required. Does it work this way? Is it becuz PHP/ASP send HTTP headers with every request and in Perl it's up to you to compose your own headers? What I really want to know is (prolly wrong site to ask) how can I submit form data to a server but not have the page redirect, like i've seen Perl/CGI scripts do? The technique i've used so far was to just redirect back to caller script as quick as possible, but it's still noticeable and I don't desire to have it be noticeable. If I use Perl to process the form data and store it in a database, does the page still need to be redirected? Thanks :) The word of the day is legs, let's go back to my house and spread the word ;P
-
When you post variables to a server via a FORM you normally do...
Once that form is submitted either directly through someone clicking on a submit button or indirectly via a function call to submit() when using PHP or ASP why does the URL always change to reflect the script that just got called? Perl doesn't appear to require you to do this. It let's you POST and no page refreshing seems required. Does it work this way? Is it becuz PHP/ASP send HTTP headers with every request and in Perl it's up to you to compose your own headers? What I really want to know is (prolly wrong site to ask) how can I submit form data to a server but not have the page redirect, like i've seen Perl/CGI scripts do? The technique i've used so far was to just redirect back to caller script as quick as possible, but it's still noticeable and I don't desire to have it be noticeable. If I use Perl to process the form data and store it in a database, does the page still need to be redirected? Thanks :) The word of the day is legs, let's go back to my house and spread the word ;P
well u can add the processing logic at the top of the form and only execute it when a certain hidden form field is set (one that u add for this purpose) ... u are always going to get a refresh when u redirect to another url (which is what a form submit does) but i have many web apps that do this and u dont see anything change
-
When you post variables to a server via a FORM you normally do...
Once that form is submitted either directly through someone clicking on a submit button or indirectly via a function call to submit() when using PHP or ASP why does the URL always change to reflect the script that just got called? Perl doesn't appear to require you to do this. It let's you POST and no page refreshing seems required. Does it work this way? Is it becuz PHP/ASP send HTTP headers with every request and in Perl it's up to you to compose your own headers? What I really want to know is (prolly wrong site to ask) how can I submit form data to a server but not have the page redirect, like i've seen Perl/CGI scripts do? The technique i've used so far was to just redirect back to caller script as quick as possible, but it's still noticeable and I don't desire to have it be noticeable. If I use Perl to process the form data and store it in a database, does the page still need to be redirected? Thanks :) The word of the day is legs, let's go back to my house and spread the word ;P
I'm not quite sure what you mean -- I use both Perl and PHP in my webapps, and they really boil down to similar methods of operation. - Mike
-
When you post variables to a server via a FORM you normally do...
Once that form is submitted either directly through someone clicking on a submit button or indirectly via a function call to submit() when using PHP or ASP why does the URL always change to reflect the script that just got called? Perl doesn't appear to require you to do this. It let's you POST and no page refreshing seems required. Does it work this way? Is it becuz PHP/ASP send HTTP headers with every request and in Perl it's up to you to compose your own headers? What I really want to know is (prolly wrong site to ask) how can I submit form data to a server but not have the page redirect, like i've seen Perl/CGI scripts do? The technique i've used so far was to just redirect back to caller script as quick as possible, but it's still noticeable and I don't desire to have it be noticeable. If I use Perl to process the form data and store it in a database, does the page still need to be redirected? Thanks :) The word of the day is legs, let's go back to my house and spread the word ;P
You can always add a target to your
tag to have the page "post" to a hidden IFRAME. example: .... .... ....
onwards and upwards...