The issue is the cPanel Error message.
I have a PHP script that auto shows (Sara Smile Is * Years of Age), and I have in (.htaccess) the line (AddType application/x-httpd-php .html), and that runs properly, however cPanel is giving this Error Message: Expected tag name. Got ‘?’ instead. (HTML doesn’t support processing instructions).
<?php
$bday = new DateTime('11.4.2010'); // Persons Date of Birth
$today = new Datetime(date('m.d.y'));
$diff = $today->diff($bday);
printf(' %d ', $diff->y, $diff->m, $diff->d);
printf("n");
?>
Is there a way to auto get (Sara Smile is * Years of Age), Without a cPanel Error message?
2
Answers
UPDATE
Here is an Easier JavaScript Code:
I always use this code to calculate in a elegant way the user age and works fine…
Output:
Answer with Only Years
Final Notes
with m-d-Y the php engine cannot calculate the diff dates, to use properly this php class you have to use the standard connotation Y-m-d. This cannot create problem since you know now that you have to call the function with this format
Hope this help.