mmm. to be honest Robert I picked this script up on the web and I have
used it as an example to show that my system will not run cgi scripts,
it also does not show any errors but opens them for editing instead. I
don't think I'm anywhere near looking at cgi.pm yet I am simply trying
to teach myself the basics so I need to get up and running first.

Thanks

Kelvin

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:ROBERT_MCCAMMON@;denso-
> diam.com]
> Sent: 11 November 2002 13:31
> To: Kelvin McWha
> Subject: Re: Unable to run cgi script
> 
> 
> 
> If I may ask, why are you using <STDIN> when using CGI.  On the CGI.PM
> help page
> it shows the the use of param().  This is much simpler to receive your
> enviromental variables.
> 
> This will be done completely inside the script.  It save considerable
> typing.
> Below shows the header.
> 
> #!/usr/bin/perl
> use CGI qv(standard);
> use strict;
> 
> 
> 
> I am trying to set my system up as a Webserver
> for testing purposes
> System is
> SuSe 8.1 stand-a-lone
> Apache 1.3
> 
> Have got Apache running OK and tested it in standalone mode using
> http://localhost
> which shows the appropriate test page
> 
> I have configured httpd.config to point to my directories as follows
> ScriptAlias /cgi-bin/??home/kelvin/cgi-bin/
> <Directory /home/kelvin/cgi-bin>
>   Options +ExecCGI
>  AddHandler cgi-script cgi pl
>  </Directory>
> 
> I am now trying to run simple html & perl scripts as shown below
> <html><head>
> <title>My test page</title>
> </head><body>
> <form method="post" action="/home/kelvin/cgi-bin/myscript.cgi">
> <PRE>
>      First Name     <INPUT TYPE="text" NAME="fname" MAXLENGTH=15
> SIZE=15>
>      Last Name      <INPUT TYPE="text" NAME="lname" MAXLENGTH=20
> SIZE=20>
>      E-Mail Addr    <INPUT TYPE="text" NAME="email" MAXLENGTH=35
> SIZE=35>
>                <INPUT TYPE="submit" VALUE="Send Mail!">
>                <INPUT TYPE="reset" VALUE="Clear-Form">
> </PRE>
> </form></body></html>
> 
> #!/usr/bin/perl
> use CGI;
> read(STDIN,$temp,$ENV{'CONTENT_LENGTH'});
> @pairs=split(/&/,$temp);
> foreach $item(@pairs)
> {
> ($key,$content)=split(/=/,$item,2);
> $content=~tr/+/ /;
> $content=~s/%(..)/pack("c",hex($1))/ge;
> $fields{$key}=$content;
> }
> print "Content-type: text/html\n\n";
> print "<HTML>\n";
> print "<BODY BGCOLOR=#FFFFFF>\n";
> print "<CENTRE>\n";
> print "Thank You<BR>\n";
> print "$fields{fname} $fields{lname}<BR>";
> print "I will write<BR>\n";
> print "you at<BR>\n";
> print "$fields{email}<BR>\n";
> print "</CENTRE>\n";
> print "</BODY></HTML>";
> 
> What happens when I run the html code and click send, is that instead
of
> running the perl script it attempts to open it. I have tried a number
of
> scripts and they all do the same. I am sure it is something simple but
> it's got me beat.
> 
> Thanking you in anticipation
> Kelvin
> 




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

Reply via email to