Please help extract date of birth from a field to other field

hello, i need help with this

I have a clients table and i have two fields
i need to extract date of birth from that social number

social number wich can be something like this 1660719221141

and date of birth

Date Of Birth 07/19/1966

so the social number is like that

1 is the gender male or female 66 is the year of birth 07 is the month and 19 is the day 22 is the town and the rest i dont care.

pls help me to can extract automatik after i insert the social numbe in the SSN field the date of birth to the specific field. Date Of Birth (DOB)
thanks

You can do it with AJAX events onchange and use PHP substr to extract the information you want

$SSN= 2690627131268;

$string = (string) $SSN;

//get the Gender
if (substr($string, 0, 1) == 2)
{
    echo "female";
}
else {
    echo "male";
}

echo ", " . substr($string, 5, 2) . "-" . substr($string, 3, 2) . "-19" .  substr($string, 1, 2);

Thank you very much for the answer, this is only to extract the gender?
I need to extract the date of birth from SSN field to the date of birth field.
Can you explain the entire process please, i mean where and how to put all the code i need to do this, i will apreciate verry much .
Thank you

Thank you, can you be more specific, i am verry new to this.
i have a table CLIENT with Name field and after the name field i have two more, SSN field and date of biorth Field
I need after i will write in the form the SSN number for each client to apear automaticaly the date of birth in the date of birth field.

Thank you verry much

$SSN = '2690627131268';
$DOB = substr($userinfo, 1, 6);
$Gender = $userinfo[0];

thank you again , but tell me pls where to put this into my scriptcase place? and only that three rows?

Hi think you should do some e-learning about PHP and Scriptcase

1 Like

i dont think you are in the right place, as i know forum is to give help if we know how to do it, if i knew PHP i never asked here, but instead i would try to help with an answer to that topic like nwbds did, you only send me to learn or say to use things. if you dont know how to do it then atleast dont asnwer.

PS You are here only to redirect people to manuals?

1 Like