Je pense que vous vous approchez de ce mauvais angle...Au lieu de soumettre le formulaire et en créant un lien à partir des valeurs de poste, et non seulement inclure les fichiers corrects...Donc, en d'autres termes, de créer des fichiers solution_1.html solution_10.html et pas les inclure, si nécessaire...comme ceci:
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>
case-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");
- }
- }
- ?>