<!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>
      &nbsp; 1 #!/usr/bin/perl<br>
      &nbsp; 2 #<br>
      &nbsp; 3 # @(#)<br>
      &nbsp; 4 #<br>
      &nbsp; 5 use strict;<br>
      &nbsp; 6 use warnings;<br>
      &nbsp; 7 use HTML::FormFu;<br>
      &nbsp; 8 use YAML::Syck qw( Load );<br>
      &nbsp; 9 use CGI qw(:standard);<br>
      &nbsp;10 use HTML::Template;<br>
      &nbsp;11 <br>
      &nbsp;12 use vars qw ($cgi_query $template $form $formret $TimeFormat);<br>
      &nbsp;13 use vars qw ($RstrLdate $RstrLtime);<br>
      &nbsp;14 #<br>
      &nbsp;15 #<br>
      &nbsp;16 my($query, $template, $formret);<br>
      &nbsp;17 my($template_out, $CGI_query);<br>
      &nbsp;18 <br>
      &nbsp;19 #<br>
      &nbsp;20 # Note: When calling "new CGI" the variables (as passed by
      apache) will fill in the<br>
      &nbsp;21 #&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; query and each variable can be accessed via:
      $form-&gt;param_value('variable_name_in_form')<br>
      &nbsp;22 $CGI_query = new CGI;<br>
      &nbsp;23 print $CGI_query-&gt;header();<br>
      &nbsp;24&nbsp;&nbsp;&nbsp;&nbsp; #<br>
      &nbsp;25&nbsp;&nbsp;&nbsp;&nbsp; # open the HTML template<br>
      &nbsp;26&nbsp;&nbsp;&nbsp;&nbsp; $form = HTML::FormFu-&gt;new;<br>
      &nbsp;27&nbsp;&nbsp;&nbsp;&nbsp; $form-&gt;load_config_file('/opt/http/forms/simple.yml');<br>
      &nbsp;28&nbsp;&nbsp;&nbsp;&nbsp; $form-&gt;action("/cgi-bin/simple_get.cgi");<br>
      &nbsp;29&nbsp;&nbsp;&nbsp;&nbsp; $form-&gt;method("post");<br>
      &nbsp;30&nbsp;&nbsp;&nbsp;&nbsp; $form-&gt;indicator("textvar");<br>
      &nbsp;31&nbsp;&nbsp;&nbsp;&nbsp; $form-&gt;query( $CGI_query ) ;<br>
      &nbsp;32&nbsp;&nbsp;&nbsp;&nbsp; $form-&gt;process();<br>
      &nbsp;33&nbsp;&nbsp;&nbsp;&nbsp; <br>
      &nbsp;34&nbsp;&nbsp;&nbsp;&nbsp; $template = HTML::Template-&gt;new(filename =&gt;
      '/opt/http/templates/simple.shtml');<br>
      &nbsp;35&nbsp;&nbsp;&nbsp;&nbsp; #<br>
      &nbsp;36&nbsp;&nbsp;&nbsp;&nbsp; # fill in some parameters in the template<br>
      &nbsp;37&nbsp;&nbsp;&nbsp;&nbsp; if ( $form-&gt;submitted ) {<br>
      &nbsp;38&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; `/bin/echo "proc: submittted" &gt;&gt;/tmp/http.log`;<br>
      &nbsp;39&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #<br>
      &nbsp;40&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $template-&gt;param( form =&gt;
      $form-&gt;param_value('textvar') );<br>
      &nbsp;41&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $template_out = $template-&gt;output;<br>
      &nbsp;42&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print $template_out . "\n";<br>
      &nbsp;43&nbsp;&nbsp;&nbsp;&nbsp; } else {<br>
      &nbsp;44&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; `/bin/echo "proc: Not-submittted"
      &gt;&gt;/tmp/http.log`;<br>
      &nbsp;45&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $template-&gt;param( form =&gt; $form );<br>
      &nbsp;46&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $template_out = $template-&gt;output;<br>
      &nbsp;47&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print $template_out . "\n";<br>
      &nbsp;48&nbsp;&nbsp;&nbsp;&nbsp; }<br>
      ===================================</tt><br>
    &nbsp;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" &lt;<a moz-do-not-send="true"
            href="mailto:xaos@darksmile.net">xaos@darksmile.net</a>&gt;
          wrote:<br type="attribution">
          &gt; Carl,<br>
          &gt; <br>
          &gt; You are quite right. However, even when I did:<br>
          &gt; <br>
          &gt; 27 $form-&gt;indicator("textvar");<br>
          &gt; <br>
          &gt; I still got same result. Actually I had a button there<br>
          &gt; called: "submit" but I removed it for the sake<br>
          &gt; of simplicity.<br>
          &gt; <br>
          &gt; How is my overall logic?<br>
          &gt; <br>
          &gt; -George<br>
          &gt; <br>
          &gt; On 5/25/11 3:04 AM, Carl Franks wrote:<br>
          &gt;&gt;&gt; First, the yml file: simple.yml<br>
          &gt;&gt;&gt; ======================<br>
          &gt;&gt;&gt; ---<br>
          &gt;&gt;&gt; auto_fieldset: 1<br>
          &gt;&gt;&gt; elements:<br>
          &gt;&gt;&gt; - type: Text<br>
          &gt;&gt;&gt; name: textvar<br>
          &gt;&gt;&gt; And last, the processing CGI file: simple_get.cgi<br>
          &gt;&gt;&gt; ======================<br>
          &gt;&gt;&gt; 27 $form-&gt;indicator("submit");<br>
          &gt;&gt; indicator('submit') tells process() that a form must
          have a value for<br>
          &gt;&gt; the field 'submit'.<br>
          &gt;&gt; Your form config doesn't have a 'submit'
          field/button.<br>
          &gt;&gt; So $form-&gt;submitted() will always be false.<br>
          &gt;&gt;<br>
          &gt;&gt; Carl<br>
          &gt;&gt;<br>
          &gt;&gt; _______________________________________________<br>
          &gt;&gt; HTML-FormFu mailing list<br>
          &gt;&gt; <a moz-do-not-send="true"
            href="mailto:HTML-FormFu@lists.scsys.co.uk">HTML-FormFu@lists.scsys.co.uk</a><br>
          &gt;&gt; <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>
          &gt;&gt;<br>
          &gt; <br>
          &gt; <br>
          &gt; _______________________________________________<br>
          &gt; HTML-FormFu mailing list<br>
          &gt; <a moz-do-not-send="true"
            href="mailto:HTML-FormFu@lists.scsys.co.uk">HTML-FormFu@lists.scsys.co.uk</a><br>
          &gt; <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>