I am trying to get the checkbox working on a submit form. All the coding in the form works except the checkbox. When I receive the mail all I see under all the working information is "checkbox". How do I get it to work so I know wether this particular "topic" was ticked or not. Been on this for a few days now !!! Starting to get crazy ideas !!!
Any help would be appreciated.
Mark
<?php
if($name) {
$name=$GET['name'];
$email=$GET['email'];
$subject1=$GET['subject'];
$message=$GET['message'];
$checkbox=$GET['as $value'];
$ip=$SERVER["REMOTE_ADDR"];
$host = gethostbyaddr($_SERVER['REMOTE_ADDR']);
$host = $ip.".".$host;
$mon=date(m);
$day=date(j);
$year=date(y);
$hour=date(g);
$min=date(i);
$sec=date(s);
$hour=$hour-2;
if($hour<=0) { $hour+=12; }
$ts = "$hour:$min:$sec on $mon/$day/$year";
$to="info@bdimedia.com";
$subject="Contact Form:"." $subject1";
$body="
Message from: $name
Subject: $subject1
E-mail: $email
Message: $message
Checkbox: $checkbox
Host: $host
Time: $ts";
mail($to, $subject, $body);
echo "<script>location.href=\"http://spekegarston.com\"</script>";
}
?>
<html>
<head>
<title>Contact Us</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
<body bgcolor="#CCCC99">
<p> </p>
<table width="95%" border="0" align="center">
<tr>
<td><font size="2" face="Arial, Helvetica, sans-serif">If you wish to have
your business listed in our directory, please complete the form and send
it to us. We will email you requesting any further information required.</font></td>
</tr>
</table>
<tr>
<td width="46%" height="534"> </td>
<td width="54%">
<form method="get" action="contact.php">
<p><font face="verdana" size="1">Your Name:<br>
<input type="text" name="name" style="border: 1px solid #cccccc; background-color: #ffffff;">
<br>
<br>
Your E-mail Address:<br>
<input type="text" name="email" style="border: 1px solid #cccccc; background-color: #ffffff;">
<br>
<br>
Subject:<br>
<input type="text" name="subject" style="border: 1px solid #cccccc; background-color: #ffffff;">
</font> <font face="verdana" size="1"><br>
<br>
Message:<br>
<font face="Verdana, Arial, Helvetica, sans-serif">
<textarea name="message" cols="60" rows="10" style="border: 1px solid #cccccc; background-color: #ffffff;"></textarea>
</font></font></p>
<p><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Send me info
on Mona Lennon
<input type="checkbox" name="checkbox" value="checkbox">
</font></p>
<br>
<p><font face="verdana" size="1"><br>
<br>
<input type="submit" value="send" style="border: 1px solid #cccccc; background-color: #ffffff;" name="submit">
</font> </p>
</form>
</font>
</body>
</html>