Código PHP:
[CODE]
<?php
session_start();
?>
<?php
$documento=$_REQUEST['documento'];
$pin=$_REQUEST['pin'];
include 'db.php';
$link=conectarse();
$no=0;
$sql="select documento,nombre,pin from administradores where documento='$documento' and pin='$pin'";
$result=mysql_query($sql,$link);
if(mysql_num_rows($result)>0){
echo"<center><br><br><h2>Cargando...</h2>";
echo"<br><body link='#f5f5f5' vlink='#f5f5f5' alink='#f5f5f5'><i><b><center><br><a href='index.html'><img src='IMAGENES/cargando.gif'alt='cargando'></img></a></i></b></body>";
$row=mysql_fetch_array($result);
$_SESSION['snombre']=$row['nombre'];
$_SESSION['admin']=1;
print "<meta http-equiv = refresh content =\"2; url=opcion.php\">";
}
else{
$result=mysql_query("select documento,nombre,especialidad,grupo,pin,codver from aprendices",$link);
if($row=mysql_fetch_array($result)) {
do {
if($documento==$row["documento"] and $pin==$row["pin"] and $row["codver"] == 0){
$_SESSION['snombre']=$row['nombre'];
$_SESSION['usuario']=1;
print "<meta http-equiv = refresh content =\"2; url=apren.php\">";
$no=1;}
}while ($row=mysql_fetch_array($result));
}
if($no==0){
echo "<center>";
echo"<br><br><i><b><h2>DATOS INVALIDOS O YA VOTÓ <br>Porfavor intente nuevamente</h2>";
echo "<br><br>";
echo"<body link='#308C9C' vlink='#308C9C' alink='#308C9C'><a href='index.html'>...Atras</a>";
echo"<br><br><center><table width='950' border='0' align='left' cellpadding='0' cellspacing='0'>
<tr>
<td align='center' valign='top'><img src='IMAGENES/piedepag.png' width='950' height='40'></td>
</tr>
</table>";
}
}
?>
[/CODE]