2015-09-25 12:05
浏览 88

如何根据第一个中选择的项目更改第二个下拉列表内容? (PHP)

I'm new to PHP.

I have a list of products in my database and I call them using:

$mysql = new MySqlManager();

$product = $mysql->getAllProducts();

Now I have two three dropdownlists: category, type, model ; of course each product belongs to one of these three categories. What I want is that when the user selects the category (i.e. fridge, vaccum cleaner, portable devices, etc.), then a second dropdownlist appears (with or without refreshing the page, I don't care) and the user can choose between the type of product based on the category (i.e. if category was fridge, then in type you would find freezer, big fridges, small fridges, etc.). Then a third dropdownlist appears and the user can choose between the different models of types of products he chose before. I hope this explanation is clear, sorry if it is not.

Please help :)

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • doushang8512 2015-09-28 09:43

    actually no one helped me: I founded that it is possible to do it directly in PHP, with a POST method redirecting to other page and then coming back to the inital and displaying another dd list (simple if with session)

    解决 无用
    打赏 举报

相关推荐 更多相似问题