<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
<tt>Ok, problem solved! Phew!<br>
<br>
I will post all the files in downloadable form<br>
at <a class="moz-txt-link-rfc2396E" href="http://www.xm5design.com/">"http://www.xm5design.com/"</a> sometime tomorrow.<br>
After I wake up!<br>
<br>
Thanks Carl! You have made my day(night).<br>
<br>
Now, I can go to sleep!<br>
<br>
George<br>
<br>
Solution: The "simple_get.cgi" script must look like this:<br>
===============================<br>
1 #!/usr/bin/perl<br>
2 #<br>
3 # @(#)<br>
4 #<br>
5 use strict;<br>
6 use warnings;<br>
7 use HTML::FormFu;<br>
8 use YAML::Syck qw( Load );<br>
9 use CGI qw(:standard);<br>
10 use HTML::Template;<br>
11 <br>
12 use vars qw ($cgi_query $template $form $formret $TimeFormat);<br>
13 use vars qw ($RstrLdate $RstrLtime);<br>
14 #<br>
15 #<br>
16 my($query, $template, $formret);<br>
17 my($template_out, $CGI_query);<br>
18 <br>
19 #<br>
20 # Note: When calling "new CGI" the variables (as passed by
apache) will fill in the<br>
21 # query and each variable can be accessed via:
$form->param_value('variable_name_in_form')<br>
22 $CGI_query = new CGI;<br>
23 print $CGI_query->header();<br>
24 #<br>
25 # open the HTML template<br>
26 $form = HTML::FormFu->new;<br>
27 $form->load_config_file('/opt/http/forms/simple.yml');<br>
28 $form->action("/cgi-bin/simple_get.cgi");<br>
29 $form->method("post");<br>
30 $form->indicator("textvar");<br>
31 $form->query( $CGI_query ) ;<br>
32 $form->process();<br>
33 <br>
34 $template = HTML::Template->new(filename =>
'/opt/http/templates/simple.shtml');<br>
35 #<br>
36 # fill in some parameters in the template<br>
37 if ( $form->submitted ) {<br>
38 `/bin/echo "proc: submittted" >>/tmp/http.log`;<br>
39 #<br>
40 $template->param( form =>
$form->param_value('textvar') );<br>
41 $template_out = $template->output;<br>
42 print $template_out . "\n";<br>
43 } else {<br>
44 `/bin/echo "proc: Not-submittted"
>>/tmp/http.log`;<br>
45 $template->param( form => $form );<br>
46 $template_out = $template->output;<br>
47 print $template_out . "\n";<br>
48 }<br>
===================================</tt><br>
On 5/25/11 3:41 AM, George Hrysanthopoulos wrote:
<blockquote cite="mid:4DDCB2B2.6020904@darksmile.net" type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
Ok, what would be an example of a "$query object".<br>
<br>
I know, I know, but Google is not helping me!<br>
<br>
George<br>
On 5/25/11 3:27 AM, Carl Franks wrote:
<blockquote
cite="mid:BANLkTim-2Q55dritUPzuUwzNeQg8OeOSYw@mail.gmail.com"
type="cite">
<p>Ah, yes -in the cgi handling the submission, process() needs
to be passed the $query object<br>
</p>
<div class="gmail_quote">On 25 May 2011 08:19, "George
Hrysanthopoulos" <<a moz-do-not-send="true"
href="mailto:xaos@darksmile.net">xaos@darksmile.net</a>>
wrote:<br type="attribution">
> Carl,<br>
> <br>
> You are quite right. However, even when I did:<br>
> <br>
> 27 $form->indicator("textvar");<br>
> <br>
> I still got same result. Actually I had a button there<br>
> called: "submit" but I removed it for the sake<br>
> of simplicity.<br>
> <br>
> How is my overall logic?<br>
> <br>
> -George<br>
> <br>
> On 5/25/11 3:04 AM, Carl Franks wrote:<br>
>>> First, the yml file: simple.yml<br>
>>> ======================<br>
>>> ---<br>
>>> auto_fieldset: 1<br>
>>> elements:<br>
>>> - type: Text<br>
>>> name: textvar<br>
>>> And last, the processing CGI file: simple_get.cgi<br>
>>> ======================<br>
>>> 27 $form->indicator("submit");<br>
>> indicator('submit') tells process() that a form must
have a value for<br>
>> the field 'submit'.<br>
>> Your form config doesn't have a 'submit'
field/button.<br>
>> So $form->submitted() will always be false.<br>
>><br>
>> Carl<br>
>><br>
>> _______________________________________________<br>
>> HTML-FormFu mailing list<br>
>> <a moz-do-not-send="true"
href="mailto:HTML-FormFu@lists.scsys.co.uk">HTML-FormFu@lists.scsys.co.uk</a><br>
>> <a moz-do-not-send="true"
href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu</a><br>
>><br>
> <br>
> <br>
> _______________________________________________<br>
> HTML-FormFu mailing list<br>
> <a moz-do-not-send="true"
href="mailto:HTML-FormFu@lists.scsys.co.uk">HTML-FormFu@lists.scsys.co.uk</a><br>
> <a moz-do-not-send="true"
href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu</a><br>
</div>
<pre wrap=""><fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
HTML-FormFu mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:HTML-FormFu@lists.scsys.co.uk">HTML-FormFu@lists.scsys.co.uk</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu</a></pre>
</blockquote>
<br>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
HTML-FormFu mailing list
<a class="moz-txt-link-abbreviated" href="mailto:HTML-FormFu@lists.scsys.co.uk">HTML-FormFu@lists.scsys.co.uk</a>
<a class="moz-txt-link-freetext" href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu</a></pre>
</blockquote>
<br>
</body>
</html>