Click to See Complete Forum and Search --> : Using Perl to write HTML....


red_of_rby
06-03-2003, 10:11 AM
Hello, I have created a form using Perl, it all works perfectly. I have one query though. At the mo I have a very basic bit of HTML at the end of it for the U.I. after a form has been processed. How could I improve on what I have to include style sheets and links?

Currently the end reads:


$MAIL->sendMail($mail_template, \%variables);

# Display a page thanking the user.
print $query->header(-type => 'text/html');
print "<html>";
print "<body>";
print "<center>";
print "Thanks for submitting your Top 5's";
print "</center>";
print "</body>";
print "</html>";

exit(0);

Cheer Ed

DaiWelsh
06-03-2003, 12:26 PM
You could write out more content in the same fashion, but it will probably make life easier for you if you redirect them to a straight html page at that point. I have not used CGI module object functions much but I would guess

print $query->header(-location => 'http://www.x.com/y/z.html');

or something similar would do you.

Then you can create a regular html page as per usual.

Just remember to either use a full url or make the path work relative to the location of the CGI script.

HTH,

Dai

Charles
06-03-2003, 01:14 PM
Read the CGI.pm documentation, http://www.perldoc.com/perl5.8.0/lib/CGI.html. And note the way to send a redirect:

print redirect('http://www.w3.org/');

red_of_rby
06-04-2003, 07:04 AM
Ok well that has worked- but now i have an exciting new problem. I can only submit one form! second attempt gives me the "Internal CGI Server Error". What is going on?! When I upload the perl script again, I can do it first time but then cant second!!! I dont understand

A baffled Ed

jeffmott
06-04-2003, 11:01 AM
I can do it first time but then cant secondYou'll have to post your code, otherwise we're left guessing.