dalehay.com
Search Engine Optimization

Easy Age Selection - PHP

If you are making your own website registration form, then on the of chance you want an age selection box then don't spend hours manually typing it in, just a 3 lines of PHP and it will automatically do it for you. Very simple!

Below is the tiny bit of code that will automatically make a dropdown box for your site. Basically it starts at 1 and goes to 100. If you want to change the numbers then edit the $i = 1 value, which is the number it starts on, then edit the $i < 101 value, which is the number it goes upto plus one, so 54 would go upto 53.

<select name="age">
<?php
for($i=1;$i<101;$i++) {
     echo "<option>$i</option>";
}
?>
</select>

Comments:

Post your comment...

Your Name:

Your Email:

Your Website URL: (With 'http://')

Posting Codes
[b]Hello[/b] makes Hello
[i]Hello[/i] makes Hello
:-) makes Dale Hay . com
:-( makes Dale Hay . com
:-D makes Dale Hay . com
:wtf: makes Dale Hay . com
;-) makes Dale Hay . com
:mad: makes Dale Hay . com
:omg: makes Dale Hay . com
:haha: makes Dale Hay . com

Your Comment:

Enter This Number:

(96338)

Note: Your IP address is saved into the database when you submit a comment. Any type of threatening behaviour will result in your ISP being contacted and legal action being taken place!



Learn how to buy at trustee
Latest News Stories
» Not good...
» Internet Explorer 8 Problems
» October
» Relaxtion by Dale Hay
» BBC Weather Revamp
» Dog Singing
Top Viewed Stories
» PHP Mini Message Board Tutorial (4,211)
» Rare McDonalds Monopoly 2008 Tickets (3,063)
» PHP Search Engine Tutorial (2,271)
» Helen Willetts Pregnant? (1,400)
» QI Series 6 on BBC One (900)
» Create your own Image Uploader (873)
Most Commented Stories
» PHP Mini Message Board Tutorial (33)
» Create your own Image Uploader (18)
» I like my DuMP (15)
» I'm on Wikipedia! (7)
» Chocie Munchin Niece (6)
» Life on Mars... (6)