Problem with form and email
| From: | vlosek at atlas dot cz | Date: | Wed, 02 Aug 2000 13:49:13 +0000 |
| Subject: | Problem with form and email | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-1716@lists.php.net to get a copy of this message | ||
Good morning, gentlemen (and ladies)
My name is Petr Vlosek and I have a serious problem.
I am a PHP beginner (that's not the problem yet:) and
I try to send some data from a form onto my email
address with the mail() command. I have two files
with php3 extension. In the first one there is a form
which contains textbox, memo and checkbox. When a
user presses SUBMIT, the second file is called, makes
the data validation and sends the data in a mail
to my address. For the textbox, no problem. For the memo,
no problem. But the checkbox (called b001) doesn't work,
dunno why. If anyone helps me to solve this problem, I'd be
very grateful.
Here are parts of the codes:
file 1
<?
echo "
<form method=\"POST\"
name=\"Boys_form\"
action=\"boysselectsend.php3\">
<table border=\"0\" width=\"100%\">
<tr>
<td width=\"50%\" valign=\"top\" align=\"right\"><div
align=\"right\"><p><label for=\"fp1\">Type
your name in here, please: </label></td>
<td width=\"50%\" valign=\"top\" align=\"left\"><div
align=\"left\"><p> <input type=\"text\"
name=\"Name\" value=\"$Name\" size=\"20\"
id=\"fp1\"></td>
</tr>
<tr>
<td width=\"50%\" valign=\"top\" align=\"right\"><div
align=\"right\"><p><label for=\"fp1\">Type
your e-mail address in here, please: </label></td>
<td width=\"50%\" valign=\"top\" align=\"left\"><div
align=\"left\"><p> <input type=\"text\"
name=\"EmailAddress\" value=\"$EmailAddress\" size=\"20\"
id=\"fp1\"></td>
</tr>
<tr>
<td width=\"50%\" valign=\"top\" align=\"right\"><label
for=\"fp1\">Type your comment in here,
please: </label></td>
<td width=\"50%\" valign=\"top\" align=\"left\">
<textarea rows=\"5\" name=\"Comment\" value=\"$Comment\"
cols=\"20\"></textarea></td>
</tr>
</table>
<div align=\"left\"><p> </p>
</div><table border=\"0\" width=\"100%\">
<tr>
<td width=\"10%\" align=\"center\"><input
type=\"checkbox\" name=\"b001\" value=\"$b001\"> 001</td>
<td width=\"10%\" align=\"center\"><input
type=\"checkbox\" name=\"b002\" value=\"$b002\"> 002</td>
</tr>
</table>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<div align=\"center\"><center><p><input type=\"submit\"
value=\"Submit\" name=\"Submit_btn\">
<input type=\"reset\" value=\"Reset\"
name=\"Reset_btn\"></p>
</center></div>
</form>
";
?>
file 2
<?
$Email = "vlosek@atlas.cz";
$Message = "Answer";
if (Mail("$Email", "$Name $Message", "Name: $Name Email address:
$EmailAddress 001: $b001 ", "From: $EmailAddress")):
echo "<br><p align=\"center\"><font
color=\"GREEN\"><big><big>Success.</big></big></font></p>";
else:
echo "<br><p align=\"center\"><font
color=\"RED\"><big><big>Failure.</big></big></font></p>";
endif;
echo "<br><div align=\"center\"><a href='index.htm'>Back
to Main Page</a></div>";
?>
Will anyone help me, please?
Thank you in advance.
Petr Vlosek