I'm trying to use the SESSION variable to pass values to the fields, as used in "login", where there is something inside the variable, will be shown in the field, but if it does not exist, nothing will be shown. How can I do the same in select ?
<div class="form-group">
<label for="nome" class="col-sm-2 control-label">Login</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="login" placeholder="Login" value="<?php echo $_SESSION['login_consultar']; unset($_SESSION['login_consultar']);?>">
</div>
</div>
<div class="form-group">
<label for="nivel_acesso" class="col-sm-2 control-label">Nível de Acesso</label>
<div class="col-sm-2">
<select class="form-control" name="nivel_acesso">
<option value="1">Administração</option>
<option value="2">Informática</option>
</select>
</div>
</div>