Using the following code, I'm getting the error "Undefined Index: area"
<select id="area" name="area" class="selectbox dropdownfilter" data-target-id="location">
<option value="">all areas</option>
<?php asort($areas) ?>
<?php foreach ($areas as $code =>$area) : ?>
<option value="<?php echo $code ?>"<?php if(isset($_SESSION['area']) | isset($_POST['area'])) { if($_SESSION['area'] == $area | $_POST['area'] == $area) { echo ' selected'; } } ?> ><?php echo $area ?></option>
<?php endforeach ?>
</select>
It's outputting the $area
correctly, the error is coming in the 'selected' script. Bit lost as to what I'm doing wrong, or how else I could do it. I'm just trying to select the option if it's what was submitted in the search form.