note 24471 deleted from function.date by victor
| From: | victor@php.net | Date: | Sun, 08 Dec 2002 20:02:27 +0000 |
| Subject: | note 24471 deleted from function.date by victor | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-40535@lists.php.net to get a copy of this message | ||
I found that heaps of payment gateways were harking it when you give them a year with no leading
'0'.. + you dont want to put a static list in your form.. so I wrote this little thingy to
do years..
<select name="card_expiry_year">
<? //generate years..
$i = date('y');
$z = $i;
while( $z < ($i+8))
{
if (($z > $i) & ($z < 10))
$z = "0".$z;
?>
<option><?=$z;?></option>
<? $z++; } ?>
</select>
Probably badly written but hopefully useful..