...

View Full Version : Data Validation



pavmoxo
05-02-2006, 11:44 AM
I have the next PHP code:


<select name="day" id="day" tabindex="3">
<?php
for($n=1; $n <=31; $n++)
{
?>
<option value="<? echo $n ?>"><? echo $n ?></option>
<?
}
?>

</select>

<select name="month" id="month" tabindex="3">
<?php
for($n=1; $n <=12; $n++)
{
?>
<option value="<? echo $n ?>"><? echo $n ?></option>
<?
}
?>
</select>


<select name="year" id="year" tabindex="3">

<?php for($i=0;$i<3;$i++) { ?>
<option><?php echo(date('Y') - $i); ?></option>
<?php } ?>

</select>


I wan´t to validate the data input. How can I do it??

chump2877
05-02-2006, 12:12 PM
use checkdate()

http://us2.php.net/manual/en/function.checkdate.php



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum