Click here to Skip to main content
15,847,264 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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:

HTML
<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>
Posted
Updated 26-Dec-13 7:12am
v3
Comments
ZurdoDev 26-Dec-13 10:22am    
Pass the value through the querystring.
Catalin Tudoroiu 26-Dec-13 10:28am    
how can I do that?
ZurdoDev 26-Dec-13 10:44am    
Where's your code that takes you to the next page?
ZurdoDev 26-Dec-13 10:44am    
Where's your code that takes you to the next page?
Catalin Tudoroiu 26-Dec-13 10:50am    
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>

1 solution

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.
 
Share this answer
 
v3
Comments
Sergey Alexandrovich Kryukov 26-Dec-13 13:57pm    
This is fair enough, but you should have added two important items:
4. Javascript
5. Ajax.

This is because the HTTP request could be send from the UI (client-side, HTML page) only by a Web form, which would be quite impractical in this case, or Ajax. Isn't it logical?
I voted 4.

—SA
Peter Leow 26-Dec-13 21:56pm    
Thank you. + virtual 5.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900