Hi Folks.
I have a select statement that pulls out names and email addresses from
a database . These values then get represented in a multiple select box
with the name as the visual value and the email as the posted value.
What I want to do is collect all the email values into a array and then
post that array off the a foreach loop where I can send a mail to all
the addresses in the email array.
Sounds simple enough but I just cant get it to work and I am beginning
to feel stoopid.
This is basically what my code looks like.
if ($var == 1)
{
$SQL="select statement";
execute etc etc
<select name =\"email\" size=\"5\" multiple>
while ( ($email, $name)=$sth ->fetchrow())
{
print "<option value=\"$email\">$name</option>";
}
</select>
}
then the form in $var == 1 sends it to $var == 2
if ($var ==2)
{
foreach $email (@in)
{
Then here is where I will send the mail.
}
}
Why is this not working?
Thanks in advance.
Justin