I think you're approaching this from the wrong angle ... Instead of submitting the form and creating a link from the post values, rather just include the correct files ... So in other words, create solution_1.html to solution_10.html files and just include them if necessary ... like so:
form.html
<form action="checkbox-control.php" method="post">
Please, check all the boxes that applies to your current sitiation:<br /><br />
<input type="checkbox" name="problem[]" value="A" />Problem 1.<br />
<input type="checkbox" name="problem[]" value="B" />Problem 2.<br />
<input type="checkbox" name="problem[]" value="C" />Problem 3.<br />
<input type="checkbox" name="problem[]" value="D" />Problem 4.<br />
<input type="checkbox" name="problem[]" value="E" />Problem 5.<br />
<input type="checkbox" name="problem[]" value="F" />Problem 6.<br />
<input type="checkbox" name="problem[]" value="G" />Problem 7.<br />
<input type="checkbox" name="problem[]" value="H" />Problem 8.<br />
<input type="checkbox" name="problem[]" value="I" />Problem 9.<br />
<input type="checkbox" name="problem[]" value="J" />Problem 10.<br />
<center><input type="submit" name="formSubmit" value="Submit" /></center><br /><br />
<br /> If your problem is not listed here then please let me know so.<br />
</form>
- <form action="checkbox-control.php" method="post">
- Please, check all the boxes that applies to your current sitiation:<br /><br />
- <input type="checkbox" name="problem[]" value="A" />Problem 1.<br />
- <input type="checkbox" name="problem[]" value="B" />Problem 2.<br />
- <input type="checkbox" name="problem[]" value="C" />Problem 3.<br />
- <input type="checkbox" name="problem[]" value="D" />Problem 4.<br />
- <input type="checkbox" name="problem[]" value="E" />Problem 5.<br />
- <input type="checkbox" name="problem[]" value="F" />Problem 6.<br />
- <input type="checkbox" name="problem[]" value="G" />Problem 7.<br />
- <input type="checkbox" name="problem[]" value="H" />Problem 8.<br />
- <input type="checkbox" name="problem[]" value="I" />Problem 9.<br />
- <input type="checkbox" name="problem[]" value="J" />Problem 10.<br />
- <center><input type="submit" name="formSubmit" value="Submit" /></center><br /><br />
- <br /> If your problem is not listed here then please let me know so.<br />
- </form>
checkbox-control.php
<?php
for($i=0;$i<11;$i++){
if(isset($_POST['problem'][$i]) && !empty($_POST['problem'][$i])){
include("includes/solution_$i.html");
}
}
?>
- <?php
- for($i=0;$i<11;$i++){
- if(isset($_POST['problem'][$i]) && !empty($_POST['problem'][$i])){
- include("includes/solution_$i.html");
- }
- }
- ?>