in reply to Re: Pre-Populating an HTML form
in thread Pre-Populating an HTML form

Thanks Kwaping, Following your scheme instead of referencing the Create.html like so: <P><A HREF="Admin_fr_create.htm" NAME="fr_body"><B>Create a New Account</B></A></P> I'd do something like create an "Admin_create.cgi" and encapsulate the Javascript and HTML within? I've been looking at PHP, Server Side Includes, Embed Perl and I'm a little overwhelmed. Using your advise, is there an example in the CGI Programming with Perl, the Camel or Cookbook?

Replies are listed 'Best First'.
Re^3: Pre-Populating an HTML form
by kwaping (Priest) on Jun 02, 2006 at 15:03 UTC
    Here's a very small example of the method I described.
    #!/usr/bin/perl use strict; use warnings; use CGI (); my $cgi = CGI->new(); my $infile = '/path/to/file.html'; open my ($fh), '<', $infile or die "Couldn't open $infile! $!"; read $fh, my ($html), -s $infile or die "Couldn't read $infile! $!"; close $fh or die "Couldn't close $infile! $!"; my $generated_password = function_to_generate_password(); $html =~ s/some_special_target_in_your_html_file/$generated_password/s +gi; print $cgi->header(); print $html;
    If you have any questions, don't hesitate to ask!

    ---
    It's all fine and dandy until someone has to look at the code.