My 1st post here :
With great difficulty I am developing a form;
I have already the input text fields now I need to add radiobuttons :
<input type="checkbox" name="chkbxarray[]" value="Male">Male
<input type="checkbox" name="chkbxarray[]" value="Female">Female
As I do not know how to do this I need some guidance to add checkbox array to the code , possibly inside the if(isset.... ;
Please help me out.
Thanks
THE CODE I HAVE ALREADY WORKING
<?php
$error = ''; // error message
$name = ''; // sender's name
$email = ''; // sender's email address
$subject = ''; // subject
$message = ''; // the message itself
$spamcheck = ''; // Spam check
if(isset($_POST['send']))
{
$name = $_POST['name'];
$email = $_POST['email'];
$subject = $_POST['subject'];
$message = $_POST['message'];
$spamcheck = $_POST['spamcheck'];
if(trim($name) == '')
{
$error = '<div class="errormsg">Por favor complete seu nome</div>';
}
else if(trim($email) == '')
{
$error = '<div class="errormsg">Por favor complete seu nome digite seu e-mail</div>';
}
else if(!isEmail($email))
{
$error = '<div class="errormsg">Voce nao digitou um e-mail válido , tente novamente.</div>';
}
if(trim($subject) == '')
{
$error = '<div class="errormsg">Por favor preencha o campo assunto.</div>';
}
else if(trim($message) == '')
{
$error = '<div class="errormsg">Por favor digite sua mensagem.</div>';
}
else if(trim($spamcheck) == '')
{
$error = '<div class="errormsg">Por favor digite o anti-spam</div>';
}
else if(trim($spamcheck) != '14')
{
$error = '<div class="errormsg">Anti-spam: o número digitado nao está correto.</div>';
}
if($error == '')
{
if(get_magic_quotes_gpc())
{
$message = stripslashes($message);
}
// the email will be sent here
// make sure to change this to be your e-mail
$to2 = "johndoe@nobody.com";
$to = "bogieman@jackfrost.com";
// the email subject
// '[Contact Form] :' will appear automatically in the subject.
// You can change it as you want
$subject = '[Formulário de contato] : ' . $subject;
// the mail message ( add any additional information if you want )
$msg = "From : $name \r\ne-Mail : $email \r\nSubject : $subject \r\n\n" . "Message : \r\n$message";
mail($to2, $subject, $msg, "From: $email\r\nReply-To: $email\r\nReturn-Path: $email\r\n");
mail($to, $subject, $msg, "From: $email\r\nReply-To: $email\r\nReturn-Path: $email\r\n");