CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Win32 Programming Help: Re: [wpearsall] running a program from the command line, called via cgi: Edit Log



fashimpaur
User

Jul 2, 2002, 1:43 PM


Views: 3967
Re: [wpearsall] running a program from the command line, called via cgi

wpearsall,

Then, barring any errors in my script in my original post, that would handle an
input from a form with an email input box for the person you are attempting to
send the mail to. Try it out and let me know if you have any problems.

Quote
If all else fails, you could do this: this is the text in a perl script to be saved as mailer.cgi


Code
   #!/user/bin/perl   
use strict;
use CGI;
my $cgi = new CGI;
my $params = $cgi->Vars();foreach my $key(keys %$params){
$params->{$key} = $cgi->escapeHTML($params->{$key});
}


my $command = qq~mailto.exe -U admin@mydomain.com -u mydomain.com -D $params->{'to'}~;
qx/$command/;print $cgi->header();
print $cgi->start_html(title => 'Done');
print "An email has been sent to you.";
print $cgi->end_html();

Then, change your action tag to be strictly this script, for example, if you named this
script "mailer.cgi":


Code
   <form action="mailer.cgi" method="post">   
<input type="text" name="to">
</form>



Good Luck,
Dennis

$a="c323745335d3221214b364d545".
"a362532582521254c3640504c3729".
"2f493759214b3635554c3040606a0",
print unpack"u*",pack "h*",$a,"\n\n";


(This post was edited by fashimpaur on Jul 2, 2002, 1:47 PM)


Edit Log:
Post edited by fashimpaur (User) on Jul 2, 2002, 1:46 PM
Post edited by fashimpaur (User) on Jul 2, 2002, 1:47 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives