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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

html form question

Status
Not open for further replies.

skwurl

Technical User
Sep 30, 2005
87
Hi there,

I have a html form for my website that uses a perl script to send the data to a desired email address. Everything works fine except for one thing...

I want to create a dropdown box that has a couple countries in it, and depending on what country you select, have the form email it to certain addresses.

i.e - USA - email1, Canada - email2, ect...

Is there any way of doing this?
 
Certainly. You would pick up the key/value pairs in your perl script and make the decision from there. That would be the most reliable way to do it.

Cheers,
Jeff

[tt]Jeff's Page [/tt][tt]@[/tt][tt] Code Couch
[/tt]
 
Hmmmm, I'm not too familiar with perl. The script was already made.

Would the edit be somewhere in here?

foreach $key (keys %FORM)
{
if ($key =~ /^_send_email/)
{
@lines = ReadFile('Email Template',$FORM{$key});
@lines = ParseText(@lines);
@lines = ParseEmail(@lines);
if ($mailserver ne '')
{SendMailBySmtp(@lines);}
else {SendMail(@lines);}
}
elsif ($key =~ /^_out_file/)
{
@lines = ReadFile('Log File',$FORM{$key});
@lines = ParseText(@lines);
LogFile('LogFile Template',@lines);
}
elsif ($key =~ /^_browser_out/ and $browser_out < 2)
{
$browser_out++;
@lines = ReadFile('Browser Template',$FORM{$key});
@lines = ParseText(@lines);
BrowserOut(@lines);
}
elsif ($key =~ /^_redirect/ and $browser_out < 2)
{
$browser_out++;
print "Location: $FORM{$key}\n\n";
}
}
 
You should be asking this question in the Perl forum.

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top