Ask a Question related to Dreamweaver AppDev, Design and Development.
-
Freebeeezz #1
Mail values from a List with Multiple Selections with PHP
Hi,
I have a little problem, I have a HTML-mailform with a List/Menu
(named informatie) witch allows Multiple Selections (Hold CTRL-key and
click mouse-button).
When I test it and select some from the list only the last selection
is shown in the e-mail and not all of the selections.
The form is Posted to a PHP mailscript, listed here below.
I think I has to do this as a array (foreach) but I can't figure it
out...
<?php
@extract($_POST);
$email = stripslashes ($email);
$naam = stripslashes($naam);
$adres = stripslashes($adres);
$postcode = stripslashes($postcode);
$woonplaats = stripslashes($woonplaats);
$info = stripslashes($info);
$prijsindicat = stripslashes($prijsindicat);
$telnr = stripslashes($telnr);
$informatie = stripslashes($informatie); // This is the MultiSelection
$opmerkingen = stripslashes($opmerkingen);
$body = "$naam heeft zojuist het formulier van de website
ingevuld.\n";
$body .= "\nAdres: $adres";
$body .= "\nPostcode: $postcode";
$body .= "\nWoonplaats: $woonplaats";
$body .= "\nInformatie sturen?: $info";
$body .= "\nPrijsindicatie sturen?: $prijsindicat";
$body .= "\nTelefoonnummer: $telnr\n";
$body .= "Informatie over: $informatie"; // This is the MultiSelection
$body .= "\nOpmerkingen: $opmerkingen";
mail('my@email.com',$subject,$body,"From: $naam <$email>");
header("location:email.htm");
?>
Who can give me some help on this one?
Thanks.....
Freebeeezz.....
Freebeeezz Guest
-
Making a page values of list and send mail
Hello Dreamweaver, I need to make quite a simple web page. It has a list of 10 items with radio buttons. The user selects some of the items by... -
Pre Fill list menu with multiple selections
Anybody tell me why this code is not working? I've tried it like every which way I can possibly think of but I can't get the values to show up as... -
submit multiple values from a list box PHP
Can any one tell me how to submit multiple values from a list box? I believe it has something to do with Arrays or Loops but i'm not sure. this is... -
Multiple Values in a list box
Hi everybody. If anyone can tell me how can I choose multiple values in a list box (by using ctrl or shift buttons) and store them in a table.... -
Selecting Multiple Values in a List/Combo Box
The following should work: On your close button add the following line before the close command getWellList docmd.close -
Freebeeezz #2
Re: Mail values from a List with Multiple Selections with PHP
Nobody ???? :-(
[email]freebeeezz@hotmail.com[/email] (Freebeeezz) wrote in message news:<1313a966.0504112323.4b96e5ea@posting.google. com>...> Hi,
>
> I have a little problem, I have a HTML-mailform with a List/Menu
> (named informatie) witch allows Multiple Selections (Hold CTRL-key and
> click mouse-button).
> When I test it and select some from the list only the last selection
> is shown in the e-mail and not all of the selections.
>
> The form is Posted to a PHP mailscript, listed here below.
> I think I has to do this as a array (foreach) but I can't figure it
> out...
>
> <?php
>
> @extract($_POST);
> $email = stripslashes ($email);
> $naam = stripslashes($naam);
> $adres = stripslashes($adres);
> $postcode = stripslashes($postcode);
> $woonplaats = stripslashes($woonplaats);
> $info = stripslashes($info);
> $prijsindicat = stripslashes($prijsindicat);
> $telnr = stripslashes($telnr);
> $informatie = stripslashes($informatie); // This is the MultiSelection
> $opmerkingen = stripslashes($opmerkingen);
>
> $body = "$naam heeft zojuist het formulier van de website
> ingevuld.\n";
> $body .= "\nAdres: $adres";
> $body .= "\nPostcode: $postcode";
> $body .= "\nWoonplaats: $woonplaats";
> $body .= "\nInformatie sturen?: $info";
> $body .= "\nPrijsindicatie sturen?: $prijsindicat";
> $body .= "\nTelefoonnummer: $telnr\n";
> $body .= "Informatie over: $informatie"; // This is the MultiSelection
> $body .= "\nOpmerkingen: $opmerkingen";
> mail('my@email.com',$subject,$body,"From: $naam <$email>");
> header("location:email.htm");
> ?>
>
> Who can give me some help on this one?
>
> Thanks.....
>
> Freebeeezz.....Freebeeezz Guest
-
Freebeeezz #3
Re: Mail values from a List with Multiple Selections with PHP
Well, I got the solution.... I gues I posted here so that anyone could
use it..
Add to your html multi-text [] to make it a "array"
In HTML it should look like this: <select name="informatie[]"
size="4" multiple id="informatie[]">
Then in the mailscript you join everyting from the array together in a
session:
$informatie = join($informatie,", ");
After that you can use the session $informatie as you like in the body
of your mail.
Have fun....
[email]freebeeezz@hotmail.com[/email] (Freebeeezz) wrote in message news:<1313a966.0504130555.d183cc5@posting.google.c om>...> Nobody ???? :-(
>
>
> [email]freebeeezz@hotmail.com[/email] (Freebeeezz) wrote in message news:<1313a966.0504112323.4b96e5ea@posting.google. com>...> > Hi,
> >
> > I have a little problem, I have a HTML-mailform with a List/Menu
> > (named informatie) witch allows Multiple Selections (Hold CTRL-key and
> > click mouse-button).
> > When I test it and select some from the list only the last selection
> > is shown in the e-mail and not all of the selections.
> >
> > The form is Posted to a PHP mailscript, listed here below.
> > I think I has to do this as a array (foreach) but I can't figure it
> > out...
> >
> > <?php
> >
> > @extract($_POST);
> > $email = stripslashes ($email);
> > $naam = stripslashes($naam);
> > $adres = stripslashes($adres);
> > $postcode = stripslashes($postcode);
> > $woonplaats = stripslashes($woonplaats);
> > $info = stripslashes($info);
> > $prijsindicat = stripslashes($prijsindicat);
> > $telnr = stripslashes($telnr);
> > $informatie = stripslashes($informatie); // This is the MultiSelection
> > $opmerkingen = stripslashes($opmerkingen);
> >
> > $body = "$naam heeft zojuist het formulier van de website
> > ingevuld.\n";
> > $body .= "\nAdres: $adres";
> > $body .= "\nPostcode: $postcode";
> > $body .= "\nWoonplaats: $woonplaats";
> > $body .= "\nInformatie sturen?: $info";
> > $body .= "\nPrijsindicatie sturen?: $prijsindicat";
> > $body .= "\nTelefoonnummer: $telnr\n";
> > $body .= "Informatie over: $informatie"; // This is the MultiSelection
> > $body .= "\nOpmerkingen: $opmerkingen";
> > mail('my@email.com',$subject,$body,"From: $naam <$email>");
> > header("location:email.htm");
> > ?>
> >
> > Who can give me some help on this one?
> >
> > Thanks.....
> >
> > Freebeeezz.....Freebeeezz Guest



Reply With Quote

