On Tuesday, October 1, 2002, at 02:27  PM, Brady Fausett wrote:

> All,
>
> Or maybe David,

I fall in the "All" category, but I'll try to help.

> I appologize in advance for my lack of sight and/or insight...
>
> I read those docs.  How can I utilize those functions on the web?  I 
> am sorry I must be really dense when it comes to this stuff...  I have 
> had the hardest time getting this to work.  I can run my script from a 
> command prompt great.  I guess I need to understand how CGI and perl 
> work together etc.  Here is the an HTML page that is suppose to call 
> the script but it still isn't working.

The short story on CGI is wonderfully simple.  Basically, you right a 
normal Perl script who will get it's input from environment variables 
and will send it's output as the "answer" that will become a web page 
the user sees.  The even better news is that CGI.pm, simplifies this 
even more.  (perldoc cgi - for more info here).

> <HTML>
> <HEAD>
>  <TITLE>Upload/Parse Data</TITLE>
> </HEAD>
>
> <BODY>
>
>  <!--#exec cgi="/usr/local/apache/cgi-bin/pw.pl"-->
>  <BR><B>Upload Successful!</B>
>  <BR>
> </BODY>
> </HTML>

This web page doesn't have a Form tag in it.  As a very basic example, 
you could add something to the body like:

<FORM METHOD=POST ACTION="PATH/TO/cgi-bin/SCRIPT_NAME.cgi">
        <INPUT TYPE=text NAME=data>
</FORM>

So, if when then wanted to read that form's input, we could use a 
script like...

#!/usr/bin/perl

use strict;

use CGI;

my $query = CGI->new();
my $data = $query->param('data');  # use NAME of field from HTML
print $query->header(); # always start a CGI printout with this format 
header
print $query->p("You entered:  $data");  # an HTML <P> tag, see CGI 
docs for more...

__END__

As you can see, pretty simple stuff.  You just have to fill in the 
details as they apply to you.

> Any ideas?
>
> Thanks,
> Brady
>
>
>
>> David,
>>
>> Sweet, thank you for the information.  Where can I find those Docs?  I
>> looked on perldoc.com and was unsuccessful.  Thanks again!
>>
>> Brady
>>
>
> sorry for not begin clear on this! on the machine where you have Perl
> install, type those in the command line:
>
> perldoc -f system
> perldoc -f exec
> perldoc -f fork
>
> if you are running a [U|Li]nux machine and you logon as root, you 
> probably
> have to change to another user before running those command.
>
> david


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to