SELECT only a certain date

They have: 71 posts

Joined: Mar 2004

Does anyone have an idea how I can pull this off? I am trying to allow users to enter in a specific date and show only results for that date. Here is the code I tried for users to enter a date:

echo "<form action=\"index.php?t=dtrack&trackdate=$year-$month-$day\" method=\"post\">";

echo " <select name=day>     ";
echo " <option value=01>1     ";
echo " <option value=02>2     ";
echo " <option value=03>3     ";
echo " <option value=04>4     ";
echo " <option value=05>5     ";
echo " <option value=06>6     ";
echo " <option value=07>7     ";
echo " <option value=08>8     ";
echo " <option value=09>9     ";
echo " <option value=10>10    ";
echo " <option value=11>11    ";
echo " <option value=12>12    ";
echo " <option value=13>13    ";
echo " <option value=14>14    ";
echo " <option value=15>15    ";
echo " <option value=16>16    ";
echo " <option value=17>17    ";
echo " <option value=18>18    ";
echo " <option value=19>19    ";
echo " <option value=20>20    ";
echo " <option value=21>21    ";
echo " <option value=22>22    ";
echo " <option value=23>23    ";
echo " <option value=24>24    ";
echo " <option value=25>25    ";
echo " <option value=26>26    ";
echo " <option value=27>27    ";
echo " <option value=28>28    ";
echo " <option value=29>29    ";
echo " <option value=30>30    ";
echo " <option value=31>21    ";
echo " </select>     ";
echo " <select name=month>     ";
echo " <option value=01>January     ";
echo " <option value=02>February     ";
echo " <option value=03>March     ";
echo " <option value=04>April     ";
echo " <option value=05>May     ";
echo " <option value=06>June     ";
echo " <option value=07>July     ";
echo " <option value=08>August     ";
echo " <option value=09>September     ";
echo " <option value=10>October    ";
echo " <option value=11>November    ";
echo " <option value=12>December    ";
echo " </select>     ";
echo " <select name=year>     ";
echo " <option value=2003>2003     ";
echo " <option value=2004>2004     ";
echo " <option value=2005>2005     ";
echo " </select>     ";
echo " <input type=submit name=submit value=Enter Daily Tracker";
echo "</form> ";
'
But the variables won't fill into the URL when I submit.

Then I have a form that is updatable, but I can't seem to get this idea to work. Any ideas?

Busy's picture

He has: 6,151 posts

Joined: May 2001

change the method to get and it should

you don't have to echo a big chunk of HTML like that, you can leave PHP, do the HTML and go back to PHP

<?php
// do some php stuff here, even an if($yes  == "yes"){
?>

HTML stuff here
and here
<?php
// back to PHP, end the if statement }

or if your page is set up to display certain bits after validation you can use EOF <<< (end of file) but which is really end of code section $value = EOF <<< .... EOF;

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.