PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I have the following problem. I have made a drop down list which is filled with items from my database. I have written the following script in order to show this list which is selected the item that corresponds to the specified registered user.
With this code I can show the list which is selected the item that corresponds to each user. What I want is in case user change this item value to other to store this value in a Session variable in order to store it afterwards in my database.
Okay, so then you need to put your select box into a form, add a submit button and if they submit the form you update the session variable. It will look something like this:
I have put the selection box into a form with a submit button. What I don't know is how can I store a change in the selection box. I don't know how can I search which item is selected so as to store it to a session variable and then clicking in the submit button store the changes in the database. If it's not clear to you what I mean I can put the whole code I have written in order to be more clear.
The IF statement checks to see if the form has been submitted. I'm thinking that Jade is re-opening the same page when the submit button is pressed. If they have clicked submit, the same page opens, but the value from your select box ($_POST['select_box_name']) is stored in $_SESSION['selectBox'].