Session in select

Asked

Viewed 79 times

-2

The select is being carried by $view->montarComboAreasNoticia(), what I want is for you to create a session to save the option I chose when I return to the selection page of select.

Code:

<select name="FArea" id="select2">
          <option value="0">
                   <?=translate("Todas")?>
          </option>
          <?$view->montarComboAreasNoticia(); ?>
</select>`
  • 1

    Well you must put the method code montarComboAreasNoticia(), modification will have to stay inside must with some simple IF must solve.

1 answer

1

Only open the session on all pages you want to remove the information:

session_start();

And assign the value in the session variable:

$_SESSION['opcao'] = $opcao

Browser other questions tagged

You are not signed in. Login or sign up in order to post.