I agree with dutchfoxer - could have said it better myself...
In more detail...
store the html template of the form in a text file (or as a html file if you prefer), this file will contain %%variables%% as described above in place of the actual content...
read the file and assign it to a scalar (eg $pageData)
then do the following ...
$_ = $pageData;
$pageData =~ s/%%name%%/$name/;
repeat for every entry in the form...
I used this same technique on the news page of www.noradskatepark.co.uk where i replaced #headline1#, #article1# etc with the actual news story....
hope that helps...
Gar...
Main Topics
Browse All Topics





by: dutchfoxerPosted on 2003-08-27 at 16:59:41ID: 9236620
The page looks like a paper form, looks professional indeed.
rends.net/ click1003/ ssl/string form.pl" onSubmit="return Validator(smartform);"> )
d>%%name%% </td></tr> y%%</td></ tr></table >
om/Program s_and_Scri pts/Perl/ F orm_Proces sing/
But actually the appearance of that page is not the credit of the usage of CGI (.pl) but good use of HTML, because it is HTML and images that make the page look that way.
I cannot be sure, but I guess they work with the CGI as follows:
1> first the cgi program creates a form you can fill in
2> it processes the contents of the form once it is submitted
3> it shows the final form with the values in the correct places
Step 1> open in CGI an HTML file with the form in it and show on the browser
Step 2> process the form (see html of form, it has this line in it
<form method="POST" .......[cut].... action="https://www.market
Step 3> with the values from the form (and possibly some calculations) display a pre-created HTML page and replace special tags with values. Example HTML with tags:
<table><tr><td>Name</td><t
<tr><td>City</td><td>%%cit
Now the cgi can replace the %%name%% with for example $name.
The above is an example of how it can be done.
There are some form generators/processors that can do it for you. You can take a look at the following URL where you can download free form processors:
http://www.cgi-resources.c