Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 04-30-2003, 05:30 AM   #1
Member (6 bit)
 
Join Date: Sep 2002
Location: Scotland
Posts: 50
CGI Perl - Change Email's recipient

Hi there,

I'm stuck on a problem with CGI-Perl. I know a little about it. Anyway, I have created a form which a visitor to send a message to one person. I have been asked to add a choice of 2 recipients.

We'll call them John (john@myemail.com) and Jane (jane@email.com).

The form has two 2 radio buttons which you only select one. Those radio buttons are a way of selecting your recipient e.g. send message to either john@myemail.com or jane@myemail.com.

The code snippet below is in the FORM.

Send Message to Recipient:<br>
John <input type="radio" value="john" name="myrecip" checked>
<br>
Jane <input type="radio" value="jane" name="myrecip"><br>


In the perl file, I have to check which the visitor chose to send the message to. This what I wrote:


if ($FORM{'myrecip'} == "john")
{
$recipient = 'john@myemail.com';
}
else
{
$recipient = 'jane@myemail.com';
}


that didn't work. Before, it was a simple task of setting the recipent to one email e.g.

$recipient = 'john@myemail.com';


The above line worked, Iwas able to get emails. However, I have to figure out some way of sending the message to the right recipent.

Can you please help?

Cheers,
Jova

Last edited by Jova; 04-30-2003 at 07:20 AM.
Jova is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 07:58 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2