I'm new php programmer
Query Form: using dropdownlist, the value consist:
<select>
<option value="today">Today</option>
<option value="LastWeek">Last week</option>
<option value="LastMonth">Last Month </option>
<select>
how to build the function and how the function can call the value to display the result.
Please help to resolve my problems.
Thank You,
Function DropdownList -Please Help Me
Moderator: General Moderators
Re: Function DropdownList -Please Help Me
when user select date range from dropdownlist,
the result will be display on the query form.
the result will be display on the query form.
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: Function DropdownList -Please Help Me
If you can determine an initial date i.e. today then you can use mktime() to get past and future dates/times etc...
Take a look at http://us.php.net/manual/en/function.mktime.php
Take a look at http://us.php.net/manual/en/function.mktime.php
Re: Function DropdownList -Please Help Me
i dont know how to build the function. can you help me how to build a simple function to display the result when user select from dropdownlist..Thanks
-
cpetercarter
- Forum Contributor
- Posts: 474
- Joined: Sat Jul 25, 2009 2:00 am
Re: Function DropdownList -Please Help Me
You need to do some reading on how php forms work.
You display a form on a page. The user choses from the drop-down menu, and then clicks "submit". The user's browser sends the chosen value to the server as a $_POST value. The server can then send a new web page back to the browser which displays the chosen value.
Like this script, which you can run as test.php:
You display a form on a page. The user choses from the drop-down menu, and then clicks "submit". The user's browser sends the chosen value to the server as a $_POST value. The server can then send a new web page back to the browser which displays the chosen value.
Like this script, which you can run as test.php:
Code: Select all
<?php
if (!isset($_POST['time'])) {
echo '<form action="test.php" method="post" enctype="multipart/form-data">';
echo '<select name="time">';
echo '<option value="today">Today</option>';
echo '<option value="LastWeek">Last week</option>';
echo '<option value="LastMonth">Last Month </option>';
echo '</select>';
echo '<input type="submit" value="submit" />';
echo '</form>';
} else {
echo "The value you chose was ".$_POST['time'];
}
?>
Re: Function DropdownList -Please Help Me
Thank you so much 