how do i make the page reloaded if i choose selected dropdown ?
assume there is a dropdown look like this
<select name="selectyear">
<option value="2000">2000</option>
<option value="2000">2001</option>
<option value="2000">2002</option>
<option value="2000">2003</option>
</select>
and a query like this
SELECT * FROM TABLEYEAR WHERE YEAR = 2014
and if i choose 2000
the page will reload and the url will look like this
http://www.dashboard.php?year=2000
and the query also will change
SELECT * FROM TABLEYEAR WHERE YEAR = 2000
i really appreciate the help..
this is my dropdown look likes ..
<select class="chzn-select deselect" name="selectyear" style="width:150px;" data-placeholder="Select year">
<option value=""></option>
<?php
$date = date("Y");
for($i = $date-10;$i<$date+5;$i++)
{
?>
<option value="<?php echo $i; ?>"><?php echo $i; ?></option>
<?php
}
?>
</select>
and this is the query .. i dont know how to put the if
statement for the query if none is selected, then display this year . if it selected, display the selected year.
$id = $_GET['year'];
$date = date("Y");
$query = mysql_query("select * from visimisi where year = '$id'");