HTML数据取决于“组合框”。 [英] HTML data depending on "combo box"

查看:60
本文介绍了HTML数据取决于“组合框”。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好。我遇到了问题。



我在HTML中有一个组合框,我想显示另一个页面,其中包含来自MySQL数据库的信息,具体取决于从组合框中选择的值。 br />


例如:组合框包含一年中的月份,根据选择的月份,我想显示该月数据库中的相应信息。 />


从下面的评论中复制的其他信息

以下是代码:



 <   body  >  

< p > 获取月份信息:

< 选择 id = name = month >

< 选项 value = 1月 > 1月< / option >
< 选项 value = 二月 > 二月< / option >
< 选项 value = March > March < / option >
< 选项 value = 四月 > 四月< / option >
< 选项 = Mai > Mai < / option >
< option value = 六月 > 六月< / option >
< 选项 value = 7月 > 7月< / option >
< 选项 value = 八月 > 8月< / option >
< 选项 value = 九月 > 九月< / option >
< 选项 value = 十月 > 十月< / option >
< 选项 value = 11月 > 11月< /选项 >
< 选项 < span class =code-keyword> = 12月 > 12月< / option >

< / select >

< / p >

< 表格 action = popup2.php 方法 = 发布 >
< 输入 类型 = 提交 value = 显示 name = 显示 >
< / form >


< / body >

解决方案

这是很容易问这样的问题,但要完成这个看似简单的任务,你需要对以下几个方面有一些了解:

1. HTML

2。 PHP

3. MySQL

为了不再遇到类似的问题,为什么不立即开始学习之旅来帮助自己。以下链接应该为您提供良好的开端:

学习HTML [ ^ ]

了解PHP + MySQL [ ^ ]

如果您在学习或编码时遇到任何问题,请到此处再次发布您的问题,最好显示一些代码。

Hello. I'm stuck here with a problem.

I have a "combo box" in HTML and I want to display another page that contains information from a MySQL database depending on the value selected from the combo box.

E.g.: the combo box contains the months of the year and depending on what month is selected, I want to display the corresponding information from the database for that month.

additional information copied from comment below
Here is the code:

<body>

  		<p>Get informations for month:
    
      <select id="month" name="month">
      
        <option value = "January">January</option>
        <option value = "February">February</option>
        <option value = "March">March</option> 
        <option value = "April">April</option>
        <option value = "Mai">Mai</option>
        <option value = "June">June</option>
        <option value = "July">July</option>
        <option value = "August">August</option>
        <option value = "September">September</option>
        <option value = "October">October</option>
        <option value = "November">November</option>
        <option value = "December">December</option>
        
      </select>
      
     </p>
       
  <form action="popup2.php" method="post" >
    <input type="submit" value="Display" name="   Display">
  </form>
  
	  
</body>

解决方案

It is easy to ask a question like this, but to accomplish this seemingly simple task, you will need to have some minimal knowledge of the following areas:
1. HTML
2. PHP
3. MySQL
In order not to stuck with the similar problems in the future, why not help yourself by starting your learning journey right away. The following links should give you a good head start:
Learn HTML[^]
Learn PHP+MySQL[^]
If you encounter any problems with your learning or coding, then come here to post your question again and preferably show some code.


这篇关于HTML数据取决于“组合框”。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆