Form validering
Hej Eksperter.Jeg har følgende form:
<form method="post" action="add.php" name="insertForm" enctype="multipart/form-data">
<br>
<table border="0">
<tr>
<td align="center" bgcolor="#dddddd">Editor:</td>
<td bgcolor="#dddddd" align="center"><input name="navn" value="" size="23"/>
</td>
</tr>
<tr>
<td align="center" bgcolor="#dddddd">Birthday</td>
<td bgcolor="#cccccc">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td>Month</td>
<td>Day</td>
<td>Year</td>
<td> </td>
</tr>
<tr>
<td><select name="month">
<option value="01" selected="selected">January</option>
<option value="02" >February</option>
<option value="03" >March</option>
<option value="04" >April</option>
<option value="05" >May</option>
<option value="06" >June</option>
<option value="07" >July</option>
<option value="08" >August</option>
<option value="09" >September</option>
<option value="10" >October</option>
<option value="11" >November</option>
<option value="12" >December</option>
</select> </td>
<td><select name="day">
<option value="01" selected="selected">1</option>
<option value="02" >2</option>
<option value="03" >3</option>
<option value="04" >4</option>
<option value="05" >5</option>
<option value="06" >6</option>
<option value="07" >7</option>
<option value="08" >8</option>
<option value="09" >9</option>
<option value="10" >10</option>
<option value="11" >11</option>
<option value="12" >12</option>
<option value="13" >13</option>
<option value="14" >14</option>
<option value="15" >15</option>
<option value="16" >16</option>
<option value="17" >17</option>
<option value="18" >18</option>
<option value="19" >19</option>
<option value="20" >20</option>
<option value="21" >21</option>
<option value="22" >22</option>
<option value="23" >23</option>
<option value="24" >24</option>
<option value="25" >25</option>
<option value="26" >26</option>
<option value="27" >27</option>
<option value="28" >28</option>
<option value="29" >29</option>
<option value="30" >30</option>
<option value="31" >31</option>
</select> </td>
<td><input type="text" name="year" value="" size="4" maxlength="4" /></td>
</tr>
</table>
</tr>
</table>
<input value="Submit" tabindex="32" type="submit">
<input value="Reset" tabindex="33" type="reset"> </td>
</form>
Er der nogle der kan hjælpe mig med, at lave en simpel php validering af feltet "year" der tjekker om det indtastet tal er mellem 1910 og 2000?
Hvis det ikke er det, så skriver den en fejl meddelse, fx: "Tallet skal være mellem 1910 og 2000"