Jump to content

Explode!


xyn

Recommended Posts

Hey,
I have a date of birth, i want to check that when the user
enters their date of birth when they register it checks for
NN NN NNNN - No less that them exact values.

For security, when they want to change their password I
wanted them to TYPE their date of birth in, instead of
selecting from a drop down...

My code is completely ioff the track, so could someone
please help me? thanks.

[code=php:0]<?PHP
$str = "".$_POST[dob_d]."/".$_POST[dob_m]."/".$_POST[dob_y]."");
$dob = explode("/", $str);

for($dob[0]=0; $dob[0]>2){ //Check day
echo 'Enter a valid day, in your Date of birth.';
return false;
}

for($dob[1]=0; $dob[1]>2){ //check month
echo 'Enter a valid month, in your Date of birth.';
return false;
}

for($dob[2]=0; $dob[2]>4){ //check year
echo 'Enter a valid Year, in your Date of birth.';
return false;
}
?>[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.