Home > Archive > PHP Language > July 2004 > Mail-form problem
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
|
| Hello,
I'm trying to make a mail-form with PHP. But the point is I want a function
so the user can choose the receiver (adress) with a drop-down menu box.
example: http://www.battaniye.net/?git=5
How can I program this in PHP ??
Can someone help me?
Thanks.
| |
|
| Joker wrote:
> Hello,
>
> I'm trying to make a mail-form with PHP. But the point is I want a function
> so the user can choose the receiver (adress) with a drop-down menu box.
>
> example: http://www.battaniye.net/?git=5
>
> How can I program this in PHP ??
That's fairly simple...
Assuming you have your addresses in a database, you select everything
(or those entries which the user is allowed to send mail to), loop over
the result and put every entry into an HTML select box.
***snip***
<select name='sendTo'>
<?php
$query = "SELECT display_name, address FROM email_adresses)";
$result = mysql_query($query);
while (list($dispName, $email) = mysql_fetch_row($result))
{
echo("<option value='".$email."'>".$dispName."</option>");
}
?>
</select>
***snap***
H.
|
|
|
|
|