
fashimpaur
User
Jul 1, 2002, 7:37 AM
Post #2 of 4
(7762 views)
|
Re: [wpearsall] running a program from the command line, called via cgi
[In reply to]
|
Can't Post
|
|
wpearsall, Not sure, but I don't think you have provided enough information. I would think the form action tag should be able to be set to mailto.exe, but I am not sure how you would pass the -U, -h and -D switches and values. These normally would be passed as parameters to a CGI script in the following manner: <form action="mailto.exe&from=admin@mydomain.com&host=mydomain.com" action="POST"> Email Address:<input type="text" name="to"> </form>
Then, when the form is sent to the cgi-bin via CGI, the start values would be passed and the value entered in the email form would be entered. I would not be thrilled with this, because someone could copy the action tag and possibly use your mailer to send stuff to the person entering the info. But, logistically, this is how it is done. I am not familiar with the mailto.exe program so my variable names are definitely in error. This was just an exercise to show how cgi parameters are passed. If all else fails, you could do this: #!/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": <form action="mailer.cgi" method="post"> <input type="text" name="to"> </form>
I hope that this answered your question. If not, repost and be more specific about the issue and what you are trying to do. Good Luck, Dennis $a="c323745335d3221214b364d545". "a362532582521254c3640504c3729". "2f493759214b3635554c3040606a0", print unpack"u*",pack "h*",$a,"\n\n";
|