[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] Raq2 and CGI scriopts



If you downloaded this script from your Qube to your RaQ, you must
change the file permissions of the script in order to be able to run.
Type

chmod 755 <scriptname>

to do this.


Wouter van Reeven


> I'm trying to get a cgi script to run on a Raq2, that I previously had
> running on a Qube2.
> This is a simple mail-form script.
> 
> The CGIwrap gives an error that says:
> CGIWrap Error: Script Execution Failed
> CGIWrap encountered an error while attempting to execute this script:
> 
> Error Message: No such file or directory
> Error Number: 2
> 
> Now,  the only files and directories that the script references are for
> perl - #!/usr/bin/perl
> and sendmail - $mailprog = '/usr/sbin/sendmail';
> 
> I've checked the server via ftp and telnet, and those are correct references
> for perl and sendmail on the Raq, ie. they do exist in those paths.
> 
> So, what directory can't it find?
> 
> I've placed the entire script below, if anyone wants to try to figure that
> one out, I'm open for suggestions.
> 
> Thanks
> 
> Eric
> 
> The CGI script mail-form.cgi
> 
> #!/usr/bin/perl
> #
> # mail-form cgi
> # © 2000 Jackie Hamilton - http://www.cgi101.com/
> #
> # Quick and dirty Web form processing script.  Emails the data
> # to the recipient.
> #
> # change this to the proper location of sendmail on your system:
> $mailprog = '/usr/sbin/sendmail';
> 
> # change this to your email address:
> $recipient = 'dbstudios1028@xxxxxxx';
> 
> # change this to your URL:
> $homepage = "http://www.danblackstudios.com/";;
> 
> # everything below this shouldn't need changing.
> #
> # Print out a content-type for HTTP/1.0 compatibility
> print "Content-type:text/html\n\n";
> 
> # Get the input and grok it into something legible
> 
> read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
> $postinput = $buffer;
> $postinput =~ s/&/\n/g;
> $postinput =~ s/\+/ /g;
> $postinput =~ s/%([\da-f]{1,2})/pack(C,hex($1))/eig;
> 
> # Now send mail to $recipient
> 
> open (MAIL, "|$mailprog -t") || die "Can't open $mailprog!\n";
> print MAIL "To: $recipient\n";
> print MAIL "From: webserver\n";
> print MAIL "Subject: Dan Black Studios Mail Form\n\n";
> print MAIL $postinput;
> print MAIL "\n\n";
> print MAIL "Server protocol: $ENV{'SERVER_PROTOCOL'}\n";
> print MAIL "HTTP From: $ENV{'HTTP_FROM'}\n";
> print MAIL "Remote host: $ENV{'REMOTE_HOST'}\n";
> print MAIL "Remote IP address: $ENV{'REMOTE_ADDR'}\n";
> close (MAIL);
> 
> # Print a thank-you page
> print <<EndHTML;
> <html>
> <head>
> <Title>Thank you</Title>
> </Head>
> <body>
> <H2>Thank you for writing!</H2>
> Thank you for contacting us.  Please Return to our
> <a href="$homepage">home page.</a><p>
> </body>
> </html>
> EndHTML
> 
> # the end.
> 
> _______________________________________________
> cobalt-users mailing list
> cobalt-users@xxxxxxxxxxxxxxx
> To Subscribe or Unsubscribe, please go to:
> http://list.cobalt.com/mailman/listinfo/cobalt-users

-- 

Wouter van Reeven
Sun Microsystems B.V.   http://www.sun.com
+31 (71) 565 7070       http://www.cobalt.com