hi,
thanks for u'r immediate answer. I tried the following script of passing data between 2 pages. I am getting name but age is still blank. date of birth i entered as yyyy-mm-dd format in text box in the first . Can u go through my code and help me to solve this problem? $_POST won't work as mine is older version of PHP.
first file
<html>
<head>
<title>Passing Data Between Pages</title>
</head>
<body>
<form action="age.php" method="POST">
Enter Your Name<input type="text" name="name">
<BR>
Enter Your Date Of Birth<input type="text" name="dob">
<input type="submit">
</form>
</body>
</html>
second one
<?
global $HTTP_POST_VARS;
$a=$HTTP_POST_VARS['name'];
$bd=$HTTP_POST_VARS['dob'];
echo "<BR>";
// echo $bd;
function getAge($bd){
$part = explode("-", $bd);
$bY = $part[0];
$bM = $part[1];
$bD = $part[2];
$cY = date("Y", time());
$cM = date("n", time());
$cD = date("j", time());
$age = $cY -$bY;
if(($cM < $bM) || ($cM == $bM && $cD < $bD)){
$age--;
}
return $age;
}
echo "<BR>";
echo "Name is $name";
echo "<BR>";
getAge($bd);
// echo $bd;
echo $bY;
echo "Age Is $age";
?>