I am working on a registration page for a website I am designing. I would like the form to check the birthrate and send people who are over 13 to complete the registration and people who are under the age of 13 taken to a page where there are instructions on what to do. Is there a way to do this?
Here is my scirpt that i have so far
//check for existance
if($firstname&&$lastname&&$username&&$password&&$repeatpassword&&$birthdate&& $gamespyid&&$base)
{
if ($password==$repeatpassword)
{
//check legths of other fields
if(strlen($firstname)>25||strlen($lastname)>25||strlen($username)>25|| strlen($gamespyid)>25)
{
echo "Max limit for First name, Last name, and username is 25 characters";
}
else
{
//password legnth
if (strlen($password)>25||strlen($password)<6)
{
echo "Password must be between 6 and 25 characters!";
}
else
{
//register
//encryptions of passwords
$password = md5($password);
$repeatpassword = md5($repeatpassword);
echo "Success!";
//open db<br>
$connect = mysql_connect("localhost","*********","*******") or die ("Couldn't Connect"); //host,username, password
mysql_select_db("**************") or die ("Could not find database");
$queryreg = mysql_query("
INSERT INTO Users VALUES('','$username','$password','$firstname','$lastname','$date','$gamespyid','$base','$birthdate','')
");
die ("Your have been registered!<a href='../index.php'>Home</a>");
}
}
}
else
echo "Your passowrds do not match!";
}
else
echo "Please fill in all fields!";