jeudi 7 avril 2016

How to get value of option from html select tag using php

 <select name=category>
    <option value='1'>Adventure</option>
    <option value='2'>Drama</option>
 </select>

I want to have the value of selected option. Like if Adventure is selected I want to store 1 or if drama is selected I want to store 2 . How can I do this using php? I have to add this data to a database table where I can't enter the name . I have to add their id . id 1 is for adventure, 2 for drama.




Aucun commentaire:

Enregistrer un commentaire