<?php
$lat = 10;
if(isSet($_GET['data_ur'])){
  $data_ur = $_GET['data_ur'];
  setCookie("data_ur", $data_ur, time() + 60 * 60 * 24 * 365 * $lat);
}
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<title>Data urodzin</title>
</head>
<body>
<p>
Witamy na stronie.
</p>

<p>
<?php
if(isSet($_COOKIE['data_ur'])){
  $data_ur = $_COOKIE['data_ur'];
  if($data_ur == date('d-m-Y', time())){
    echo "Ale fajnie, masz dzisiaj urodziny!";
  }
}
else if(!isSet($data_ur)){
  $data_ur = "DD-MM-RRRR";
}
?>
</p>

<form action='index.php' method='get'>
<div>
Tu możesz wprowadzić datę urodzin: 
<input type='text' name='data_ur' value='<?php echo $data_ur; ?>' />
<br />
<input type='submit' value='Wyślij' />
</div>
</form>

</body>
</html>
