I have a gallery page that change the category based on the $_POST("cat"), how do I use the option dropdown list to reload the page (or only the gallery) to change the gallery view accordingly.
Here is the option list:
<form>
<select>
<option value="">Pick A Category:</option>
<option value="1">Landscape</option>
<option value="2">Wedding</option>
<option value="3">Miscellaneous</option>
</select>
</form>
Here is the php option list :
<?php
$dir_cat[0] = "images/landscape/";
$dir_cat[1] = "images/wedding/";
$dir_cat[2] = "images/misc/";
if (isset($_POST['cat']) && isset($dir_cat[$_POST['cat']])) {
// alocate image category according to the POST value
$image_dir = $dir_cat[$_POST['cat']];
} else {
// set default image category
$image_dir = $dir_cat[0];
?>