Click to See Complete Forum and Search --> : Having SSI and info from a processed form in the same page?


dominicanpapi82
09-03-2006, 03:56 PM
I need to do the following:

I have a page example.com/formpage/ where I have a form to be processed. When it is processed, I need to take the info from the form and either create a page or go to a page with the following:

<!--#include virtual="/includes/include1.ssi" -->

(INFO FROM PROCESSED FORM HERE)

<!--#include virtual="/includes/include2.ssi" -->

I can't get around the fact that I can only put a server side include into a file with the .shtml extension, and if I have a prewritten page I can't figure out how to add info from a processed form into it. Does anyone know how to do this that can help me?

Charles
09-03-2006, 05:43 PM
I'm not exactly sure what you are trying to do. You can include the output from a script <!--#include virtual="mail.pl" --> and you can read a file with Perl effectively including it to the output.

dominicanpapi82
09-03-2006, 06:08 PM
I'm not exactly sure what you are trying to do. You can include the output from a script <!--#include virtual="mail.pl" --> and you can read a file with Perl effectively including it to the output.

How do I do that without a serious performance hit?

dominicanpapi82
09-04-2006, 12:00 AM
Instead of doing server side includes, I'm doing this:

# open file1.txt
open(FONE,"file1.txt");
# print one line at a time
while (my $line = <FONE>) {
print $line;
}
close(FONE);

(INSERT PROCESSED FORM HERE)

# open fileTWO.txt
open(FTWO,"fileTWO.txt");
# print one line at a time
while (my $line = <FTWO>) {
print $line;
}
close(FTWO);

Does anyone know from experience how slow this might be if, say, the sum of the number of lines in fileONE.txt and fileTWO.txt is about 700? I'll find out in the next few weeks when I actually do everything, but if this takes over 10 seconds I better research another way to do this.

CyCo
09-04-2006, 06:42 PM
require LWP::UserAgent;

my $ua = LWP::UserAgent->new;
my $top = $ua->get('http://your.domain.com/includes/include1.ssi'); # must be absolute url
my $bot = $ua->get('http://your.domain.com/includes/include2.ssi'); # must be absolute url


print $top->content;

(INFO FROM PROCESSED FORM HERE)

print $bot->content;

dominicanpapi82
09-05-2006, 11:51 AM
Thanks. I'll try that out too, see which is fastest.