No drcyber lo puse al principio de mi script mira aqui te pongo el codigo:
Código PHP:
<?php
session_start();
include('funciones/rellenar.php');
$ncuenta = $_POST['ncuenta'];
$fecha = $_POST['nip'];
$fndia = substr($fecha,0,2);
$fnmes = substr($fecha,2,2);
$fnano = substr($fecha,4,4);
$_SESSION['ncuenta'] = $ncuenta;
?>
<html>
<head>
<title>Vinculación UNAM-FESC Egresados Bienvenido</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#F9C300" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0">
<table width="800" cellpadding="0" cellspacing="0" align="center">
<tr>
<td colspan="3">
<img src="imagenes/cabecera.jpg" width="799" height="128">
</td>
</tr>
<tr>
<td background="imagenes/fondo.jpg" width="150" align="left" valign="top">
<?php
include('menu.html')
?>
</td>
<td width="500" bgcolor="#CCCCCC" align="left" valign="top">
<?php
if(!checkdate($fnmes, $fndia, $fnano)){
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#2a166f" colspan="2">
<div align="center">
<font color="FF0000"><strong>Error al Momento de Ingresar</strong></font>
</div>
</td>
</tr>
<tr>
<td colspan="2">
<h3>Fecha de Nacimiento Incorrecta</h3>
<div align="justify">
<font size="2">La fecha de Nacimiento: <?php echo "$fndia - $fnmes - $fnano" ?> no es una fecha valida
favor de corregirla.<br>
<center><a href="javascript: history.back()">Atras</a></center>
</font>
</div>
</td>
</tr>
</table>
<?php
}
else{
include('formato.php');
}
?>
</td>
<td background="imagenes/fondo.jpg" width="150" align="left" valign="top">
<?php
include('general.html')
?>
</td>
</tr>
<tr>
<td colspan="3" width="100%" bgcolor="2a166f">
</td>
</tr>
</table>
</body>
</html>