I'm trying to store a $_SESSION variable on a form option for further use on the next page after submit (which will be reloaded and used multiple times after that, so a simple $_POST won't do)
the problem is that it doesn't matter what option I choose, it always saves the value from the last option ("Victoria" in this case) as if I picked that one.
session_start(); is already declared on top of the page
Am I missing something? Here is the form:
<form method="post">
<label for="turno">Turno:</label>
<select name="turno" id="turno">
<option value=DIA>Dia</option>
<option value=NOCHE>Noche</option>
</select>
<label for="planillera">Planillera:</label>
<select name="planillera" id="planillera">
<option value="<?php $_SESSION['planillera'] = 'Rosa'; ?>">Rosa</option>
<option value="<?php $_SESSION['planillera'] = 'Cristina'; ?>" >Cristina</option>
<option value="<?php $_SESSION['planillera'] = 'Maria'; ?>" >Maria</option>
<option value="<?php $_SESSION['planillera'] = 'Romina'; ?>">Romina</option>
<option value="<?php $_SESSION['planillera'] = 'Julieta'; ?>" >Julieta</option>
<option value="<?php $_SESSION['planillera'] = 'Victoria'; ?>" >Victoria</option>
</select>
<input type="submit" id='enviar' value="Registrar viaje" formaction="registrar_viaje.php">
</form>
</div>