mail() through a form
| From: | Jennifer Downey | Date: | Sat, 27 Apr 2002 05:58:56 +0000 |
| Subject: | mail() through a form | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-94861@lists.php.net to get a copy of this message | ||
Hello to all,
I have a mail script with a set of options in a dropdown list that I'm
hoping you can help with.
Here is the part I wish to get working then after that I can do the rest
What I need this to do is send the users name, email address, the option in
the drop down list, and the message. I can't seem to get it to do this could
someone point out what I have done wrong?
$query = "SELECT * FROM {$config["prefix"]}_users WHERE uid =
{$session["uid"]}";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
$name = $row['name'];
$email = $row['email'];
if($submit)
{
if($automail == 'abuse')
{
$From = $name;
$to = "abuse@atthisaddress.com";
mail( $to, $From, $email, $message );
}
else
{
else
{
echo"<FORM ACTION='$PHP_SELF' METHOD='POST'
TITLE='contact'>";
echo "<br><br><br><br><br>Your User Name: $name";
echo "<br><br>Your Email Address: $email<br>Did your email<br>change?
<a
href='myaccount.php'>Click here<BR><BR></a>";
echo "This is a ";
echo "<SELECT NAME='automail' SIZE='1'>";
echo "<OPTION VALUE='abuse'>Abuse</OPTION>";
echo "<OPTION VALUE='bug'>Bug</OPTION>";
echo "<OPTION VALUE='job'>Employment</OPTION>";
echo "</SELECT> Report<BR>";
echo "The message is<BR>";
echo "<TEXTAREA NAME='message' ROWS='10' COLS='40'>";
echo "</TEXTAREA>";
echo "<BR><INPUT TYPE='submit' VALUE='Send Report'
NAME='submit'>";
echo "</FORM>";
}
Thanks
Jennifer
--
The sleeper has awaken
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002