hi. i have the following code:
$now=getdate();
$currMonth = $now["month"];
$currYear = $now["year"];
$currDay = $now["mday"];
for($i=1; $i<=12; $i++){
$month = date("F",mktime(0, 0, 0, $i));
if ($month == $currMonth)
echo "<option value='".$month."' selected='selected'>".$month."</
option>";
else
echo "<option value='".$month."'>".$month."</option>";
}
all i want to do is dynamically output a selection box containing all
the months of the year, and have the selection default to the current
month. however, i'm not sure why it's not working. please help.
thanks 3 1265
whatchamakeofit schrieb:
hi. i have the following code:
$now=getdate();
$currMonth = $now["month"];
$currYear = $now["year"];
$currDay = $now["mday"];
for($i=1; $i<=12; $i++){
$month = date("F",mktime(0, 0, 0, $i));
if ($month == $currMonth)
echo "<option value='".$month."' selected='selected'>".$month."</
option>";
else
echo "<option value='".$month."'>".$month."</option>";
}
all i want to do is dynamically output a selection box containing all
the months of the year, and have the selection default to the current
month. however, i'm not sure why it's not working. please help.
thanks
Why not using $now['mon']; ? 1-12
And later if ($i == $now['mon']) ?
thx, that works!
but, i'm still wondering, why wouldn't my previous code work?
On Jul 12, 10:14 am, Olaf Schinkel <tr...@schinkel.tvwrote:
whatchamakeofit schrieb:
hi. i have the following code:
$now=getdate();
$currMonth = $now["month"];
$currYear = $now["year"];
$currDay = $now["mday"];
for($i=1; $i<=12; $i++){
$month = date("F",mktime(0, 0, 0, $i));
if ($month == $currMonth)
echo "<option value='".$month."' selected='selected'>".$month."</
option>";
else
echo "<option value='".$month."'>".$month."</option>";
}
all i want to do is dynamically output a selection box containing all
the months of the year, and have the selection default to the current
month. however, i'm not sure why it's not working. please help.
thanks
Why not using $now['mon']; ? 1-12
And later if ($i == $now['mon']) ?
whatchamakeofit wrote:
hi. i have the following code:
$now=getdate();
$currMonth = $now["month"];
$currYear = $now["year"];
$currDay = $now["mday"];
for($i=1; $i<=12; $i++){
$month = date("F",mktime(0, 0, 0, $i));
if ($month == $currMonth)
echo "<option value='".$month."' selected='selected'>".$month."</
option>";
else
echo "<option value='".$month."'>".$month."</option>";
}
all i want to do is dynamically output a selection box containing all
the months of the year, and have the selection default to the current
month. however, i'm not sure why it's not working. please help.
thanks
Works for me.
--
*****************************
Chuck Anderson • Boulder, CO http://www.CycleTourist.com
Nothing he's got he really needs
Twenty first century schizoid man.
*********************************** This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Market Mutant |
last post by:
I just wonder job selections, job openings and salary level of PHP programer
or Perl programmer comparing to Java programmers.
Is Java programmer's salary has a minimal of 60K in US? Are there...
|
by: Job Lot |
last post by:
How can compare two dates in terms of months. i.e.
01/08/2004 = 10/08/2004
05/08/2004 < 01/08/2005
thanx
|
by: JazeMail |
last post by:
I've only ever used built in SQL Server tools but have been looking at
log tools. I looked at Log Explorer 4.02 from lumigent.com and was very
impressed with what I saw. The prices tag per instance...
|
by: Robert Dell |
last post by:
I have a problem comparing strings in an order form i'm writing. I want
to give a running total at the bottom of the page and it appears to be
working except it doesn't compare correctly (it...
|
by: Lisa |
last post by:
Hello! I need help to organize the working time spent by each employee
on projects.
I have many projects going on, staring at different dates, and each
employee can work on 0/N projects, for #...
|
by: Rajat Tandon |
last post by:
Hello Everybody,
Please guide me so that I can fulfill this challenging assisnment ...
I have been asked to "Restructure a Windows application" from scratch in 2
months. The existing...
|
by: Working_Girl |
last post by:
Hi,
I have a database with insurance clients and their dependents (spouses
and children). We had a problem in the past with the twins and some of
them have been entered with one month...
|
by: gderosa |
last post by:
Hey everyone...I need to create a job which occurs once monthly that is based on a stored procedure that contains as a rough example:
CREATE PROCEDURE CompareDate
@CurrentDate datetime
AS
...
|
by: bus007 |
last post by:
I want to input months through the combo box and display data from a table that matches the particular month in ms access.
Please give me an idea how to do it??
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |