On Tue, Aug 14, 2007 at 01:15:59PM +0200, Jeremiah Foster wrote:
> 
> Hello,
> 
>       I am hoping to do a search of a file based on user input. I already  
> have my template and I was hoping to put a <form> tag in it so that I  
> might get user input, then pass that to a cgi script to do the search  
> logic.
> 
> If I use the following:
> 
>    [%- CGI.start_form({ action => '/cgi-bin/search.cgi' });
> 
>         CGI.textfield('search','',30,30);
>         CGI.submit('');
>         CGI.end_form.join(''); %]
> 
> I can then get the value of the textfield with [% SET string =  
> CGI.param('search') %}
> 
> However, how can I paste that onto the URL so that the search cgi  
> script pointed to by the action parameter sees the CGI.param 
> ('search') string?


Assuming you just mean you want a request to show up with a URL like:
http://blah.com/cgi-bin/search.cgi?search=something+to+search+for

Then you are wanting the browser to do a "GET" request form post.
You can get this with:
[%- CGI.start_form({ method=>'get', action => '/cgi-bin/search.cgi' });


The browser will then automatically tack all the input parametes on to
the URL.

If you are using the CGI module in your search.cgi though it should
handle either GET or POST requests that do not contain the parameters on
the URL string.


> 
> 
> Jeremiah Foster
> [EMAIL PROTECTED]
> ---
> Key fingerprint = 9616 2AD3 3AE0 502C BD75  65ED BDC3 0D44 2F5A E672

-- 
Todd Freeman  Ext 6103                   .^.    Don't fear the penguins!
Programming Department                   /V\
Andrews University                      // \\    http://www.linux.org/
http://www.andrews.edu/~freeman/       /(   )\   http://www.debian.org/
                                        ^^ ^^

Attachment: signature.asc
Description: Digital signature

Reply via email to