[Za-pm] Maintaining state

Mark Hewitt mh2 at isis.co.za
Fri Sep 12 05:48:22 CDT 2003

On 12 September, 2003 12:14, Werner Moller [SMTP:wernerm at ifusion.co.za]
> What do you mean with CGI/ServerPage intervention? I'm open for any
> suggestions.

The form submission must be handled by a CGI script on the server, be it

> The only thing I can think of is parsing it like so:
> #!/usr/bin/perl
> use CGI qw/:standard/;
> # Define field variables here from MySQL data queries after login.
> # Open DB etc...
> $name = param('name'); # etc...
> open HTML, "<htmlpage.html";
> 	while (<HTML>) {
> 		# code here with form fields containing perl variables as
> values in html page.
> 		# ...
> 		print;
> 	}
> close HTML;
> # End here

Thats pretty much what I was alluding to in my earlier post regarding this.
Except I am sure the are Perl modules already built for decent template
handling,  but simple find & replace of fields work 100%

> Do you think this will work? Still have the problem of parsing the values
> the next link though.

In what way? You mean variables you calcuate in your example script, and
want to part of the links in the template you print? In your HTML template,
simply make a "variable" that will be replaced by the caculated value:


<p><a href="go_to_this_page.cgi?my_value={something}">Click here</a></p>

[in cgi above]

$something = calculate_it();


$html_output = s/\{something\}/$something/gi;


print $html_output;

> Cheers,
> Werner

Windows, Linux and Internet Development Consultant
Cell: +27 82 9655295
Email: corporate at scriptsmiths.com
Web: http://www.scriptsmiths.com

> -----Original Message-----
> From: Nico Coetzee [mailto:nico at itfirms.co.za]
> Sent: 11 September 2003 17:01
> To: Werner Moller; 'za-pm at mail.pm.org'
> Subject: Re: [Za-pm] Maintaining state
> Virtually  impossible - you need some server side CGI/ServerPage
> intervention.
> On Thursday 11 September 2003 09:54, Werner Moller wrote:
> > Hi Guys,
> >
> > I need to maintain state (cookies, variables, sticky widgets or
> > on a website where users log in and need to retrieve their information.
> > However, the html pages and forms have already been designed with
> > DreamweaverMX which rules out dynamic page generation with CGI. How do I
> go
> > about retrieving information and placing it on the fields in the html
> pages
> > after the user have logged in? I've completed the "Registration" scripts
> > which place the information into a MySQL database.
> >
> > Werner Moller
> > _______________________________________________
> > Za-pm mailing list
> > Za-pm at mail.pm.org
> > http://mail.pm.org/mailman/listinfo/za-pm
> -- 
> Nico Coetzee
> http://www.itfirms.co.za/
> http://za.pm.org/
> http://forums.databasejournal.com/
> To the systems programmer, users and applications serve only to provide a
> test load.
> _______________________________________________
> Za-pm mailing list
> Za-pm at mail.pm.org
> http://mail.pm.org/mailman/listinfo/za-pm
"DISCLAIMER: This e-mail and its attachments may contain information that is
confidential and that may be subject to legal privilege and copyright. If
you are not the intended recipient you may not peruse, use, disclose,
distribute, copy or retain this message. If you have received this message
in error, please notify the sender immediately by e-mail, facsimile or
telephone and return and thereafter destroy the original message.Please note
that e-mails are subject to viruses, data corruption, delay, interception
and unauthorised amendment, and that the sender does not accept liability
for any damages that may be incurred as a result of communication by e-mail.
No employee or intermediary is authorised to conclude a binding agreement on
behalf of the sender by e-mail without express written confirmation by a
duly authorised representative of the sender. By transmitting this e-mail
message over the Internet the sender does not intend to allow the contents
hereof to become part of the public domain, and the confidential nature of
the contents shall not be altered or diminished from by such transmission."

More information about the Za-pm mailing list