Self Processing Form PHP

Hey,

I need to make a form that takes info like name, address (basic info) then I will have 4 check boxes. When the user clicks the check box I want an email sent back to them with the information that they requested.

I have a html page that has the form that submits to a php page below. What would I add in to redirect based on the check boxes that the user checks? (still learning PHP) thanks!:

<?php

$subject = ‘test’;
$emailadd = ‘info@test.com’;
$url = ‘thx.html’;
$req = ‘1’;

$text = "Results from form:

“;
$space = ’ ';
$line = ’
';
foreach ($_POST as $key => $value)
{
if ($req == ‘1’)
{
if ($value == ‘’)
{echo “$key is empty”;die;}
}
$j = strlen($key);
if ($j >= 100)
{echo “Name of form element $key cannot be longer than 100 characters”;die;}
$j = 100 - $j;
for ($i = 1; $i <= $j; $i++)
{$space .= ’ ‘;}
$value = str_replace(’
', “$line”, $value);
$conc = “{$key}:$space{$value}$line”;
$text .= $conc;
$space = ’ ‘;
}
mail($emailadd, $subject, $text, ‘From: ‘.$emailadd.’’);
echo ‘<META HTTP-EQUIV=Refresh CONTENT="0; URL=’.$url.’”>’;
?>