Long since expired
Everybody has something they check—the way someone holds a spoon, the rings on their fingers. I check online order forms. Specifically, I check the form where the customer is expected to fill in the expiration date of their credit card.
There, did you notice it too? The one which would let you fill in a date in 2003? Oops, someone hard-coded the years into the order form. This is not a forward-thinking webmonkey.
After once re-hard-coding an order form at my old job for a newer set of years, I changed our code such that it automatically provides the current year plus the next ten as options. It’s not hard:
<select name="year">
<?php
$this_year = date("Y");
for ($i=0; $i<10; $i++) {
echo "<option>";
echo $this_year + $i;
echo "</option>\r";
}
?>
</select>
Go forth and write similar code in whatever other template system the Man is forcing you to use…
Now Playing: Forever from Us And Us Only by The Charlatans
Comments
Posted by: JM | December 17, 2005 12:24 PM