-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgetEdad.php
38 lines (31 loc) · 997 Bytes
/
getEdad.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body>
<form action="" method="POST">
<div>
La edad es:<input type="text" value='{$_POST['apellido_doc']}'>
<input type="date" name="fecha" required>
</div>
<input type="submit" value="GetEdad">
</form>
<?php
// echo date("Y-m-d") . '<br>';
if ($_POST['fecha'] > date("Y-m-d")) {
echo "FECHA SELECIONA ES INCORRECTA";
} elseif ($_POST['fecha'] < date("Y-m-d")) {
require_once 'clases/utils.php';
echo "hay else" . '<br>';
echo utils::getEdad($_POST['fecha']); // Imprimirá la fecha correcta
}
else
?>
</body>
</html>