I have this category listing
<?php
$var = explode('|', $_POST['categories']);
?>
<div id="cardContainer">
<div class="wrapper">
<div class="catList">
<div class="categories">
<h2>Categories</h2>
<form method="post">
<select id="categories" name="categories">
<option value="">Choose a category</option>
<option value="1|page1.html">Real Estate</option>
<option value="2|page2.html">Commercial Auto</option>
<option value="3|page3.html">Beauty/Salon</option>
<option value="4">Health</option>
<option value="5">Construction</option>
<option value="6">Legal</option>
<option value="7">Furniture</option>
<option value="8">Food</option>
</select><!-- end id="categories" -->
</form>
</div><!-- end class="categories" -->
</div><!-- class="catList" -->
<!-- START IMAGE LISTINGS -->
<div class="imgList">
<?php include($var); ?>
</div>
<!-- END IMAGE LISTINGS -->
</div><!-- end class="wrapper" -->
</div><!-- end id="cardContainer" -->
and a <?php include(''); ?>
on the bottom.
How can I insert th e value of the option chosen to the include('');
in php?
I am kind of new with php and any help is appreciated thank you.
Edit: I want to open the page depending on the category seleted trying to use the include();
method. If that's not the best way to go can you please let me know? Thanks in advance.