在html / php页面中选择和选项

I've got this issue In a simple html/php page I should create something like that: Selection of Italian Region

select name="" value=""
option value="0">Abruzzo</option
option value="1">Basilicata</option
option value="2">Calabria</option
....                    
/select

After this selection, when user chose the one, I have to show a specific list of Reseller. How can I set it in Php/Html? can someone write to me an example of the code ?

Thanks.

Hie,

If you have a Dropdown menu and on user select you would want to display a list of results based on the user selection, there are few options you can use.

Using simple php and javascript.

  • Use Javascript or jquery onClick function.

  • Once user selects an option trigger javascript to reload the page with id=selected value

  • On a page refresh use php function ISSET . If id in your url is set display the result by calling database and retrieving the data.

Using AJAX and Jquery

  • Again use Onclick or on select or onChange jquery function

  • If user selects or changes the drop down value trigger ajax call via Jquery

  • Make a php function (or a page) where it retireves data from database.

    eg: function getData($option){ --retrieve data--}

  • After you retrieve Data use an id tag to display the list of results on your page.