Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

re:perl

Status
Not open for further replies.

raji96

Programmer
Aug 7, 2001
64
0
0
US
I have two text fields in the html page and one hidden field which has an email id.Can someone tell me how to submit this page to a cgi script and make it send the values of the two text to the email id in the hidden field?

Thanks.
 
You FORM 'action' tag's value should contain the script to which you are posting to.

You also need to find out the absolute pathname to your mail program (like sendmail) on the server .

Heres a sample script which could be of help to you

===========================================================

use CGI;

$input = new CGI;


# Replace the value in brackets with the name of your first
# text field .

$text1 = $input->param('text1');

# lll'y for the second text field
$text2 = $input->param('text2');


# Recipient Email
$email = $input->param('email')


$mailprog = 'path-to-you-mail-program-here'

open(MAIL,"| $mailprog -t") or die "Failed to contact mail program'";

select MAIL;


print &quot;From:<sender>&quot;;
print &quot;To: $email&quot;;
print &quot;Subject:<Subject>\n\n&quot;
print &quot;Mail Body here&quot;


close MAIL ;
select STDOUT;






===========================================================


HTH

regards
C






&quot;Brahmaiva satyam&quot;
-Adi Shankara (788-820 AD)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top