Ver Mensaje Individual
  #9 (permalink)  
Antiguo 12/01/2006, 13:29
Avatar de calavera
calavera
 
Fecha de Ingreso: diciembre-2005
Mensajes: 113
Antigüedad: 18 años, 3 meses
Puntos: 0
Ni lo uno ni lo otro

Me imprime un mensaje en otra pag. al hacer click en ingresar, en el cual me dice rut valido!! a un rut ke no es el correcto, y rut invalido!! a uno ke si lo es, lo ke necesito es ke cuando el rut sea correcto lo ingrese y no me envie ese mensaje y cuando sea incorrecto si me envie un mensaje.
TODO ESTO SUCEDIO CUANDO LE GENERE LA SENTENCIA EXIT;


equipos.php

Código PHP:
<html>
<head>
<frame><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><noframes></frame></noframes>
<script language="JavaScript">
function validar(form)
{
var error = "Por favor, antes de enviar el formulario,\ncomplete todos los campos:\n\n";
var a = ""

    if (form.N_Serie.value == "") { a += " Nº de Serie\n"; }
   /* if (form.Tipo.value == "") { a += " Tipo\n"; }
    if (form.Marca.value == "") { a += " Marca\n"; }*/
    /*if (form.Modelo.value == "") { a += " Modelo\n"; }*/
    if (form.Fecha_Compra.value == "") { a += " Fecha de Compra\n"; }
    if (form.N_Factura.value == "") { a += " Nº de Factura\n"; }
    if (form.Rut_Proveedor.value == "") { a += " Rut del Proveedor\n"; }
/*    if (form.Rut_Asignado.value == "") { a += " Rut Asignado\n"; }*/
    if (form.Descripcion.value == "") { a += " Descripcion\n"; }

    if (a != "") { alert(error + a); return true; }

form.submit()
}

</script>

</head>

<link href="Estilos/equipos.css" rel="stylesheet" type="text/css">

<body bgcolor="#2C89AD">
<form name="Ingresa" action="Procesar.php"  method="post" >
  <table width="576" border="0" cellpadding="0" cellspacing="0" class="checkbox">
          <td width="119">&nbsp;</td>
      <td width="16">&nbsp;</td>
      <!--DWLayoutTable-->
    <tr> 
      <td height="29" colspan="10" valign="top"><div align="center"> 
          <table width="100%" border="1">
            <!--DWLayoutTable-->
            <tr> 
              <td width="100%" height="20" valign="top" bgcolor="#FFCC33"> <div align="center"><font color="#666666" size="3" face="Courier New, Courier, mono"><strong>.:<font color="#000000">EQUIPOS</font>:.</strong></font></div></td>
            </tr>
            </table>
          <font color="#666666" size="4"></font></div>
      <td>&nbsp;</td>
    <tr> 
      <td height="21" colspan="10" valign="top"><hr></td>
      <td></td>
    </tr>
    <tr> 
      <td height="2"></td>
      
    </tr>
    <tr> 
      <td height="12" colspan="2" valign="top"><font size="1">N&ordm; de Serie:</font></td>
      <td colspan="2" rowspan="3" valign="top"> <input type="text" name="N_Serie"> 
      </td>
      <td colspan="2" valign="top"><font size="1">Fecha de Compra:</font></td>
      <td colspan="3" rowspan="3" valign="top"> <input type="text" name="Fecha_Compra" ></td>
      <td colspan="2" valign="top"><font color="#CC0033" size="1">Ej: (2000-11-05)</font></td>
    </tr>
    <tr> 
      <td height="4"></td>
      <td></td>
           <td></td>
    </tr>
    <tr> 
      <td colspan="2" rowspan="2" valign="top"><font size="1">Tipo:</font></td>
      <td height="1"></td>
      <    </tr>
    <tr> 
      <td rowspan="5" valign="top"> <select name="Tipo" id="select">
        </select></td>
      <td height="11"></td>
      <td rowspan="2" valign="top"><font size="1">N&ordm; de Factura:</font></td>
      <td></td>
      <td colspan="3" rowspan="4" valign="top"> <input type="text" name="N_Factura"></td>
      <td></td>
      <td></td>
    </tr>
    <tr> 
      <td height="1"></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
    </tr>
    <tr> 
      <td height="4"></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
    </tr>
    <tr> 
      <td height="1"></td>
      <td></td>
      <td></td>
      <td colspan="2" rowspan="3" valign="top"><font size="1">Rut del Proveedor:</font></td>
      <td></td>
      <td></td>
    </tr>
    <tr> 
      <td height="3"></td>
      <td></td>
      <td></td>
      <td colspan="3" rowspan="4" valign="top"> <input name="Rut_Proveedor" type="text"  size="0"></td>
      <td></td>
      <td></td>
    </tr>
    <tr> 
      <td rowspan="2" valign="top"><font size="1">Marca:</font></td>
      <td height="8"></td>
      <td rowspan="4" valign="top"> <select name="Marca" id="Marca">
        </select></td>
      <td></td>
      <td></td>
      <td></td>
    </tr>
    <tr> 
      <td height="4"></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
    </tr>
    <tr> 
      <td height="2"></td>
      <td></td>
      <td></td>
      <td rowspan="4" valign="top"><font size="1">Rut Asignado:</font></td>
      <td></td>
      <td></td>
      <td></td>
    </tr>
    <tr> 
      <td height="6"></td>
      <td></td>
      <td></td>
      <td></td>
      <td rowspan="4" valign="top"> <select name="Rut_Asignado" id="Rut_Asignado">
        </select></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
    </tr>
    <tr> 
      <td height="2"></td>
      <td></td>
      <td rowspan="4" valign="top"> <select name="Modelo" id="Modelo">
        </select></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
    </tr>
    <tr> 
      <td colspan="2" rowspan="2" valign="top"><font size="1">Modelo:</font></td>
      <td height="4"></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
    </tr>
    <tr> 
      <td height="8"></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
    </tr>
    <tr> 
      <td height="6"></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
    </tr>
    <tr>
      <td height="18"></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
    </tr>
    <tr> 
      <td height="12" colspan="2" valign="top"><font size="1">Descripci&oacute;n:</font></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
    </tr>
    <tr> 
      <td height="19">&nbsp;</td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
    </tr>
    <tr> 
      <td height="137"></td>
      <td></td>
      <td colspan="6" rowspan="2"> <textarea name="Descripcion" cols="40" rows="10" wrap="PHYSICAL"></textarea> 
        <input type="button" name="Submit" value="Ingresar" onClick="validar(this.form)"> 
      </td>
      <td> 
      <td> 
      <td> </tr>
  </table>
</form>

 <?php
    
include("conex.php");
    
$link=Conectarse();
   
$result=mysql_query("select * from Equipos",$link);
?>
 
</table>
<table width="571" border="0" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr> 
    <td width="48" height="2"></td>
    <td width="195"></td>
    <td width="67" rowspan="2" valign="top"><form name="form1" method="post" action="Busqueda.php">
        <input name="Busqueda" type="submit" id="Busqueda" value="Buscador">
      </form></td>
    <td width="5"></td>
    <td width="60" rowspan="2" valign="top"><form name="form2" method="post" action="Borra.php">
        <input name="Borra" type="submit" id="Borra" value="Eliminar">
      </form></td>
    <td width="5"></td>
    <td width="65" rowspan="2" valign="top"><form name="form3" method="post" action="Modificar.php">
        <input name="Modificar" type="submit" id="Modificar" value="Modificar">
      </form></td>
    <td width="126"></td>
  </tr>
  <tr> 
    <td height="18" valign="top"><a href="http://www.gorebiobio.cl">Volver</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
  </tr>
</table>
<table width="571" border="0" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr> 
    <td width="234" height="3"></td>
    <td width="85"></td>
    <td width="63"></td>
    <td width="85"></td>
    <td width="104"></td>
  </tr>
  <tr> 
    <td height="20">&nbsp;</td>
    <td valign="top"><form action="Funcionarios.php" method="post" name="Funcionarios" id="Funcionarios">
        <input name="Funcionarios" type="submit" id="Funcionarios" value="Funcionarios">
      </form></td>
    <td>&nbsp;</td>
    <td valign="top"><form action="Proveedores.php" method="post" name="Proveedores" id="Proveedores">
        <input name="Proveedores" type="submit" id="Proveedores" value="Proveedores">
      </form></td>
    <td>&nbsp;</td>
  </tr>
  <tr> 
    <td height="21" colspan="5" valign="top"> <hr align="left"></td>
  </tr>
  <tr> 
    <td height="32" colspan="5" valign="top"><table width="100%" height="32" border="0">
        <!--DWLayoutTable-->
        <tr> 
          <td width="100%"> <div align="center">Sitio Desarrollado por la Unidad 
              de Informatica del Gobierno Regional de la Region del Bio Bio <br>
              Caupolican 330 Concepci&oacute;n - Mesa Central 41-405700 <br>
            </div></td>
        </tr>
      </table></td>
  </tr>
</table>
</body>
</html>

Cita:
Iniciado por Cluster
Y no te funciona así? .. que dice? (Rut valido o lo contrario? ..)

Usa:

Código PHP:
if (ValidaDVRut($Rut_Proveedor)==$rut_digito) {   
    echo (
"Rut válido!!");   
    } else {   
    echo (
"Rut inválido!!");  
    }   

exit; 
// para detener la ejecución del script en ese punto y ver que mensaje obtienes . .por qué ya te comenté que NO puedes hacer eso si luego haces un header() 
Un saludo,