Ver Mensaje Individual
  #5 (permalink)  
Antiguo 23/07/2009, 15:42
Avatar de DjMiki
DjMiki
 
Fecha de Ingreso: octubre-2007
Ubicación: Paijan - Trujillo - La Libertad
Mensajes: 90
Antigüedad: 16 años, 7 meses
Puntos: 2
Pregunta Respuesta: Limitar Cantidad de Registros a Usuarios

Bueno amigos estuve haciendo el codigo para este validacon y no se que pueda estar haciendo mal que no me valida adecuadamente, es mas ni siquiera valida, osea que yo registro 10 veces , y cuando intento hacerlo nuevamente me sigue registrando cuando se supone que no debe hacerlo, no se porfavor les pediria que revicen mi codigo y me digan que error estoy cometiendo.
eH AQUI EXPONGO MI CODIGO
Código PHP:
 <?
$x
=$_GET[ok];
if (
$x=="1"){
$nomusu=htmlentities($_POST['nomusu']);
$genusu=htmlentities($_POST['genuser']);
$usergb=htmlentities($_POST['idusergb']);
$fechareg=$_POST['fechausugb'];
if (empty(
$nomusu) ){
echo 
"<b>Error Debes ingresar todos tus datos<br>";
echo 
"Click <a href='reg.php'>Aqui</a> para Regresar</b>";
exit();
}
$verificaCant="select * from promo_gb where fechareg_gb=$fechareg";
$result=mysql_query($verificaCant,$dblink)or die(mysql_error);
if (@
mysql_num_rows($result) < 10){
$insertDatos="insert into promo_gb (nom_gb, idusergb_gb, genero_gb, fechareg_gb) values ('$nomusu','$usergb','$genusu','$fechareg')";
$result1=mysql_query($insertDatos,$db_link) or die(mysql_error);
?>
<div align="center">
  <font size="+2"><strong>EXITO</strong></font><br>
    Datos Registrados con exito.
</div>
<? }else{ ?>
<div align="center"><font size="+2"><strong>ERROR</strong></font><br>
  Los registros Actualmente estan cerrados</div>
<? }else{ ?>
FORMULARIO EN HTML<? }?>