Re: mod_Perl script and SSI need advice
C Here is an example of what I mean: C Here is a basic form built with cgi.pm. C Name the script test C print header; C if (param(foo)) { C print start_html, C You Entered: ,em(param(foo)), C } C else { C print start_html, C start_form(-action=/perl/test), C Enter something : ,textfield(foo), C submit, C end_form, C } C print end_html; C Works with no errors under CGI and Apache::Registry C Then I would add the above script as an include in the C following page (demo.shtml): C html C head C titleTest SSI Page/title C /head C body C pThis is a test page/pbr C !--#include virtual=/perl/test -- C /body C /html C So the when I access demo.shtml, I see the text from C the HTML page and also the form from the included C scipt. C When I fill out the form and hit submit, the returned C data gets printed to the screen: C You Entered plus whatever you entered in the form. C What I would like to do is fill out the form, submit C it, and end up back to the shtml page with the result C of the script (rather than the form) included in the C shtml. C I understand why this is happening, I am not asking C why, all I am asking is what is the preferred method C of accomplishing this. C Thanks Form action have to be not perl script, but your *.shtml file. And in your include you must send QUERY_STRING to perl script. I don't remember exactly, but ther were problems with POST data, because it I've stoped using SSI. Thanks for the reply, but what would you use rather than SSI ? I am not committed to SSI, it is just what I know at this moment. Thanks __ Do you Yahoo!? Yahoo! Mail Plus Powerful. Affordable. Sign up now. http://mailplus.yahoo.com
Re: mod_Perl script and SSI need advice
Coexec wrote: Hi all, I have a question about how to pass form data with mod_perl and SSI. I have an HTML page with a mod_perl script included. The script creates a form and takes its input and then prints output based on the input (pretty basic). I have the form action set to the script (action=/perl/test.cgi), the problem is that when the form is submitted, the only thing that gets printed to the screen is the cgi output. I could have the mod_perl script process the information and then generate a new URL and appended a Query_string and then redirect($url1?$foo=$bar). I am sure that there is a better way to do this, I just don't know what it is. I'm afraid I don't quite understand your description of the problem. Is it that the SSI is not working, or that the CGI isn't getting the right input, or what? Can you show us some of the code from the HTML page and the CGI script? How are you running the CGI? Apache::Registry? - Perrin
Re: mod_Perl script and SSI need advice
Coexec wrote: Hi all, I have a question about how to pass form data with mod_perl and SSI. I have an HTML page with a mod_perl script included. The script creates a form and takes its input and then prints output based on the input (pretty basic). I have the form action set to the script (action=/perl/test.cgi), the problem is that when the form is submitted, the only thing that gets printed to the screen is the cgi output. I could have the mod_perl script process the information and then generate a new URL and appended a Query_string and then redirect($url1?$foo=$bar). I am sure that there is a better way to do this, I just don't know what it is. I'm afraid I don't quite understand your description of the problem. Is it that the SSI is not working, or that the CGI isn't getting the right input, or what? Can you show us some of the code from the HTML page and the CGI script? How are you running the CGI? Apache::Registry? - Perrin Here is an example of what I mean: Here is a basic form built with cgi.pm. Name the script test print header; if (param(foo)) { print start_html, You Entered: ,em(param(foo)), } else { print start_html, start_form(-action=/perl/test), Enter something : ,textfield(foo), submit, end_form, } print end_html; Works with no errors under CGI and Apache::Registry Then I would add the above script as an include in the following page (demo.shtml): html head titleTest SSI Page/title /head body pThis is a test page/pbr !--#include virtual=/perl/test -- /body /html So the when I access demo.shtml, I see the text from the HTML page and also the form from the included scipt. When I fill out the form and hit submit, the returned data gets printed to the screen: You Entered plus whatever you entered in the form. What I would like to do is fill out the form, submit it, and end up back to the shtml page with the result of the script (rather than the form) included in the shtml. I understand why this is happening, I am not asking why, all I am asking is what is the preferred method of accomplishing this. Thanks __ Do you Yahoo!? Yahoo! Mail Plus Powerful. Affordable. Sign up now. http://mailplus.yahoo.com