Ahh - so simple. Thank you superdoc.
I now have a working script. Unfortunately couldn't use TFMal because I don't have permission for sendmail. I ended up with the following. Probably a bit clunky but it works.
#! /usr/bin/perlml use Mail::Sendmail; use CGI; @values=(); &parse; &send; &thanks; sub parse { my $q = new CGI; my $data = $q->param('POSTDATA'); @values = split (/[\s=]+/, $data); } sub send { $mail{'smtp'} = "smtp.###.co.za"; $mail{'port'} = 465; $mail{'auth'} = {user => '###@###.co.za', password => '###'}; %mail = ( To => '###@###.co.za', From => "@values[3]", Message => "@values[1]\n\n@values[5]" ); sendmail(%mail) or die $Mail::Sendmail::error; } sub thanks { print "Content-type: text/html \n\n"; print <<END; <html> <head> <title>Thank you for your message</title> <meta http-equiv="Content-Type" content="text/html; c +harset=utf-8" /> <meta http-equiv="Content-Language" content="en" /> <link rel="stylesheet" type="text/css" href="/css/gen +eral.css" /> <link rel="stylesheet" type="text/css" href="/css/tha +nks.css" /> </head> <body> <div id="header"> <img id="small-logo" alt="### Logo" src="/graphic +s/LogoSmall.jpg" height="80" width="80" /> <div id="nav"> <ul> <li><a href="/index.html">home</a></li> <li><a href="/about.html">about us</a></l +i> <li><a href="/products.html">products</a> +</li> <li><a href="/customers.html">customers</ +a></li> <li><a href="/gallery.html">gallery</a></ +li> <li><a href="/contact.html">contact us</a +></li> </ul> </div> </div> <div id="content"> <h1>Thank you for leaving a message</h1> <p>We will respond as soon as possible.</p> </div> </body> </html> END }
In reply to Re^5: Not getting form data from stdin (nms-cgi)
by trewornan
in thread Not getting form data from stdin
by trewornan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |