Ask a Question related to PHP Development, Design and Development.
-
Shaun #1
Print current and next three years
Hi,
I am trying to print the current and next three years in a form. Using the
following code I can only print 2000, 2001, 2002, 2003:
<select name="start_date_year">
<?php
$i = 1;
while ($i <= 4){
if ($i + 1 == date("Y", strtotime($_GET[mysql_date]))){
echo '<option value="'.date("Y", mktime(0, 0, 0, 0, 0, $i)).'"
selected>'.date("Y", mktime(0, 0, 0, 0, 0, $i)).'</option>';
} else {
echo '<option value="'.date("Y", mktime(0, 0, 0, 0, 0,
$i)).'">'.date("Y", mktime(0, 0, 0, 0, 0, $i)).'</option>';
}
$i++;
}
?>
</select>
How can I get this code to start looping from the current year?
Thanks for your help
Shaun Guest
-
Print a pdf document with a current timestamp...
I'd like to be able to print a pdf with the current date and time. I found a third party s/w to do the job but I believe Acrobat is capable of doing... -
how can I print current page
have a multi page SWF that uses an external JPEG for each page. The jpegs are loaded into the SWF from instructions in an XML file. How can I have a... -
Print current frame. Real easy one I think.
Hi, sorry for the ridiculously simpleness of this question, but I want to print everything happenign in the flash movie at a certain point. Kind... -
How to change the current thread current culture at run time.
I have created a new culture : Dim objCulture As New CultureInfo("he") //hebrew When I tried to assign it to the current thread. ... -
Send current record data in one form to another and print?
On Tue, 15 Jul 2003 10:09:12 -0700, "Seddon Acaster" <seddonandjulia@acas.demon.co.uk> wrote: Clarification: The Form doesn't contain any... -
Becoming Digital #2
Re: [PHP] Print current and next three years
<select name="start_date_year">
<?
for( $i=0;$i<3;$i++ ) {
$year = date( 'Y' )+$i;
echo '<option value="'.$year.'">'.$year.'</option>';
}
?>
</select>
Edward Dudlik
Becoming Digital
[url]www.becomingdigital.com[/url]
----- Original Message -----
From: "Shaun" <shaun@mania.plus.com>
To: <php-general@lists.php.net>
Sent: Wednesday, 24 September, 2003 08:29
Subject: [PHP] Print current and next three years
Hi,
I am trying to print the current and next three years in a form. Using the
following code I can only print 2000, 2001, 2002, 2003:
<select name="start_date_year">
<?php
$i = 1;
while ($i <= 4){
if ($i + 1 == date("Y", strtotime($_GET[mysql_date]))){
echo '<option value="'.date("Y", mktime(0, 0, 0, 0, 0, $i)).'"
selected>'.date("Y", mktime(0, 0, 0, 0, 0, $i)).'</option>';
} else {
echo '<option value="'.date("Y", mktime(0, 0, 0, 0, 0,
$i)).'">'.date("Y", mktime(0, 0, 0, 0, 0, $i)).'</option>';
}
$i++;
}
?>
</select>
How can I get this code to start looping from the current year?
Thanks for your help
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Becoming Digital Guest



Reply With Quote

