Im trying to make in PHP checkboxes that will include 1, 2 or 3 files when selected:
Index.php:
Code: Select all
<form action="checkbox-form.php" method="post">
Select the options:<br />
<input type="checkbox" name="formDoor[]" value="A" />First option<br />
<input type="checkbox" name="formDoor[]" value="B" />Second Option<br />
<input type="checkbox" name="formDoor[]" value="C" />Third Option<br />
<input type="submit" name="formSubmit" value="GENERATE" />
</form>
Code: Select all
<?php
$aDoor = $_POST['formDoor'];
if(empty($aDoor))
{
echo("You didn't select any options.");
}
else
{
echo("
if $aDoor == A
then #include A.php
");
?>
When option A is selected A.php is included, when B is selected B.php is included etc.
I also want when multiple options are included: like A and C, it includes both A.php and C.php.
Any ideas how I can figure this out?