Forum Moderators: coopster
<form action="formokinscripcion.php" method="post" name="inscripcion" target="_blank" id="inscripcion" value="Inscribirme">
I have an html page with the form and a php page called formokinscripcion.php
the php page code looks like this:
<?
$formulario = "Bla";
$emailreceptor = "my@email.bla";
?>
<?
$receptor .= "E-mail: $email\n";
$receptor .= "\n";
$receptor .= "----------Remote info ----------\n";
$receptor .= "$HTTP_USER_AGENT\n";
$receptor .= "$REMOTE_ADDR\n";
mail("$emailreceptor", "$formulario", $receptor, "From: $email");
?>
But the html form has 4 checkboxes. And those values I'm not receiving. I don't know how the code for the php page should go...
First, your checkbox fields are creating an array called $pet. Which leads me to ask what do you want to do with the information from these fields once they are passed to the form handler (formokinscripcion.php)?
[added]Just looked your post over again - do you want to include the results of those fields in the email?[/added]
$pet_boxs=$_REQUEST['pet']; //Collects Array
$pet_finished = ""; //He's the one we want
$pet_template = " \$pet_single,"; //Needed for later Eval
foreach($pet_boxs as $pet_single) //Breaks the Array down
{
eval("\$pet_finished.=\"".$pet_template."\";"); //Processes Array and ships information to $pet_finished
}
/*So Now, lets say the only boxes checked were "dog" and "cat" (in that order) . . if you were to print() $pet_finished , you would have litterly " dog, cat,".*/
So when shipping information to the email *thinks thats your intensions*, just ask for $pet_finished. Hope this is what you were lookin for.