Hi everyone,
I’m trying to submit a form that contains a list of options and the list itself, and then to display the list with the selected option in the next page.
For some reason it’s working the first time but not on further attempts: do you know what could be the issue?
Thanks a lot!
jy
Here’s the code of the page :
<?php $list = $_POST['list']; $check = $_POST['check']; $year = $_POST['year']; if ($check != 1) { $check = 1; $list = " 2000 2001 2002 "; } else { $replace = " selected='selected'"; $by = ""; $list = str_replace($replace,$by,$list); $replace = $year . "'>"; $by = $year . "' selected='selected'>"; $list = str_replace($replace,$by,$list); } ?> <?php echo $list; echo ""; echo ""; ?>