There's a better way (in my opinion to do this). Have two arrays for your checkboxes, age and state.
15<input type="checkbox" name="age[]" value="15"><br>
16<input type="checkbox" name="age[]" value="15"><br>
17<input type="checkbox" name="age[]" value="17"><br>
Alabama<input type="checkbox" name="state[]" value="Alabama"><br>
Alaska<input type="checkbox" name="state[]" value="Alaska"><br>
Arizona<input type="checkbox" name="state[]" value="Arizona"><br>
Then in your PHP page, instead of using $age1 or $age2 etc, you use implode to find all the recors where the values have an age of any of the ages selected AND the state is any of the states selected. the IN clause is like saying OR (everything inside parenthesis). So your PHP for the above form would look something like this:
$query = mysql_query("SELECT * FROM your_table WHERE age IN ('" . implode("','", $_POST['age']) . "') AND
state IN ('" . implode("','", $_POST['state']) . "')") or die(mysql_error());
You can obviously add more checkboxes, but make sure they're all named either age[] or state[]
Cgraz