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!

help- retrieving multiple select items print to email with perl

Status
Not open for further replies.

sup15dog

Programmer
Jul 25, 2003
1
0
0
US
I have this cgi that retrieves the values form the form and sends and email to both me and the person who filled it out. originally the form had a single select pull down menu but i altered it to have multiple values. the problem is that i can't seem to get the values and if i do, i get the first one selected and not the rest.

the snippets of code are as follows:

...
$emailaddress = $query->param('email');
@values = @{$query->param('interest')}; ----->this is how i was getting the multiple values
$var_1 = $query->param('firstname');
$var_1 =~ s/\.\.//g;
...
...
print MAIL <<LINE;
From: $emailaddress
To: $to
Subject: Form.

The following was submitted via the website contact form
(from host $remote_host):

Area of Interest: ------>what do i put here so that the multiple values end up in the email?

First Name: $var_1
...
...
close MAIL;
//}

please help if you can. its been stressing me out for a long time!

thanks
 
Hi,

I would recommend you to use the CGI-module.
Just:

use CGI;
$cgi=CGI->new();
@selected_items=$cgi->param('my_multiple_select');

foreach(@selected_items)
{
...blabla...
}

Hope that helps

--
Smash your head on keyboard to continue...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top