How to create a current year to 1900 select box.

Rate this script on 1 to 5 bases, 1 being lowest, 5 being highest.


  • Total voters
    5

Brandon

Former Senior Account Rep
Community Support
Messages
19,181
Reaction score
28
Points
48
Well it will create a current year to 1900 select box.

Demo: http://development.brandonsgames.com/2007box.php

Use the code

PHP:
<select name="year">
<?php 

/* 
Current Year to 1900 box generator
Brandon Long <brandon@x10hosting.com> 
Demo: http://development.brandonsgames.com/2007box.php
*/

// Auto-updates to current year, can be changed to any year.
$year = date("Y");

while ($year > 1899) {  
echo '<option value="'.$year.'">'.$year.'</option>
';
$year = $year - '1';
}

?>
</select>

So the box right now would be 2006 to 1900, it can be updated to go the other way easily. Post here any questions or e-mail me.
 

Chris Z

Active Member
Messages
5,603
Reaction score
0
Points
36
i'd give it a 5, btw, thanks for helping me with KleenAS :) hahah
 

Chris Z

Active Member
Messages
5,603
Reaction score
0
Points
36
another thing though, could you do the same for the months and dates :), that would be appreciated too :p :)
 

Brandon

Former Senior Account Rep
Community Support
Messages
19,181
Reaction score
28
Points
48
Later today, its 2 am damit....:nuts:

Think I code all night.
 

Chris Z

Active Member
Messages
5,603
Reaction score
0
Points
36
lol sometimes...haha i'm sick of coding, i think i'm done for the night..
 
Top