PHP - Error de vinculo

 
Vista:
sin imagen de perfil
Val: 51
Ha aumentado su posición en 27 puestos en PHP (en relación al último mes)
Gráfica de PHP

Error de vinculo

Publicado por Hector (47 intervenciones) el 18/12/2007 03:15:09
Hola amigos del foro, mi duda es la siguiente que les presente
Vínculos rotos:

man_usuarios.php menu/mnu1.js

Vínculos externos:

man_usuarios.php <?=$PHP_SELF."?".$SID?>

Archivos: 1 Total, 1 HTML
Archivos 3 vínculos en total, 1 correctos, 1 rotos, 1 externos
lo que pretendo que cuando el usuario no esta registrado que realice un click lo mismo de siempre y que se diriga a la siguiente pagina, lo hace pero no me muestra los formularios de ingreso, creao que lo que hice est malo pero no se en donde esta el error, de todas meneras les presento el código que estoy utilizando para que me digan en donde esta mi error, ojala que me puedan ayudar ya que me encuentro más que desesperado, desde ya muchas gracias.

<?php
session_start();
//Variables de usuario
session_register('nom_usu');
session_register('rut_usu');
session_register('clave_usu');
$_SESSION['nom_usu'];
$_SESSION['rut_usu'];
$_SESSION['clave_usu'];

if ($nom_usu!="" and $rut_usu!="" and $clave_usu!=""){

//Abre librerias y funciones
include "conexion.inc";

//Conexion con sitio y bd
$conx_sitio= $conx_sitio = conexion();
$conx_bd= $conx_bd = conexion();

?><head>
<script language="JavaScript" type="text/JavaScript">

function seleccion(Nombre,Rut,Clave,Cías.){
form1.tx_nombre.value=Nombre;
form1.tx_rut.value=Rut;
form1.tx_clave1.value=Clave;
form1.tx_clave2.value=Clave;
form1.tx_compania.value=Cías.;

}
</script>
</head>

<title>Usuarios</title>
<center><script menumaker src="menu/mnu1.js"></script></center>
<form name="form1" action="<?=$PHP_SELF."?".$SID?>" method="post">
<center><u><b><font size="5" color="#003399">Usuarios</font></b></u></center>
<table border="0" align="center">
<tr><td><table border="0"><tr>
<td><font color="#CC0000">*</font></td>
<td>Nombre:</td>
<td><input name="tx_nombre" type="text" id="tx_nombre" tabindex="1" size="30" maxlength="30"></td>
</tr>

<tr><td><font color="#CC0000">*</font></td>
<td>Rut:</td>
<td><input name="tx_rut" type="text" id="tx_rut" tabindex="2" size="12" maxlength="12"></td>
</tr>

<tr>
<td><font color="#CC0000">*</font></td>
<td>Clave:</td>
<td><input name="tx_clave1" type="password" maxlength="6" size="6" tabindex="3">  Confirme Clave:
<input name="tx_clave2" type="password" maxlength="6" size="6" tabindex="4"></td></tr>

<tr>
<td><font color="#CC0000">*</font></td>
<td>Cía:</td>
<td><input name="tx_compania" type="text" id="tx_compania" tabindex="5" size="10" maxlength="10">       [<font color="#CC0000">*</font> <em><font size="2">= datos obligatorios</font></em>]</td>
</tr>
</table>

<td><table border="0">
<tr>
<td><input name="bt_grabar" type="Submit" value=" Grabar " tabindex="6"></td>
</tr>

<tr>
<td><input name="bt_eliminar" type="Submit" value=" Eliminar " tabindex="7"></td>
</tr>

<tr>
<td><input type="reset" name="bt_cancelar" value="Cancelar" tabindex="8"></td>
</tr>

</table></td>
</tr>
</table><br>

<table border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF">
<th></th>
<th bordercolor="#999999" bgcolor="#003399"><font color="#FFFFFF">Nombre</font></th>
<th bordercolor="#999999" bgcolor="#003399"><font color="#FFFFFF">Rut</font></th>
<th bordercolor="#999999" bgcolor="#003399"><font color="#FFFFFF">Compañía</font></th>
</tr>
<tr>

<?php
//Inserta nuevo o modifica
if ($bt_grabar!=""){
$tx_nombre=$_POST['tx_nombre'];
$tx_rut=$_POST['tx_rut'];
$tx_clave1=$_POST['tx_clave1'];
$tx_clave2=$_POST['tx_clave2'];
$tx_compania=$_POST['tx_compania'];

//Validacion
if ($tx_nombre==""){
$err_valida="Nombre=vacio ";
}
if ($tx_rut==""){
$err_valida.="- Rut=vacio ";
}
if ($tx_clave1==""){
$err_valida.="- Clave=vacia ";
}
if ($tx_clave2==""){
$err_valida.="- CONFIRMACIÓN Clave=vacia ";
}
if ($tx_clave1!=$tx_clave2){
$err_valida.="- CONFIRMACIÓN Clave=erronea ";
}
if ($err_valida!=""){
?>
<script>javascript:alert("<? echo $err_valida ?>")
form1.tx_nombre.value="<? echo $tx_nombre ?>";
form1.tx_rut.value="<? echo $tx_rut ?>";
form1.tx_clave1.value="<? echo $tx_clave1 ?>";
form1.tx_clave2.value="<? echo $tx_clave2 ?>";
form1.tx_compania.value="<? echo $tx_compania ?>";
</script><?
}else{
$csql=mysql_query("select * from ingreso where clave_usuario='$tx_clave1'");
if (mysql_num_rows($csql)){
$csql = "UPDATE ingreso SET nombre_usuario='$tx_nombre',rut_usuario='$tx_rut',compañia='$tx_compania'";
$csql.= " WHERE clave_usuario='$tx_clave1'";
}else{
$csql = "INSERT INTO ingreso(nombre_usuario, rut_usuario, clave_usuario, compañia)";
$csql.= " VALUES ('$tx_nombre','$tx_rut','$tx_clave1', '$tx_compania')";
}
//Ejecuto la sentencia
mysql_db_query("Liquidacion", $csql);
}

//Elimina
}elseif ($bt_eliminar!=""){
$tx_clave1=$_POST['tx_clave1'];
$csql=mysql_query("select * from ingreso where clave_usuario='$tx_clave1'");
if (mysql_num_rows($csql)){
$csql = "DELETE FROM ingreso";
$csql.= " WHERE clave_usuario='$tx_clave1'";
//Ejecuto la sentencia
mysql_db_query("Liquidacion", $csql);
}else{
//Se esta tratando de eliminar un registro que no existe
?><script>javascript:alert('No se puede eliminar un registro ¡NO EXISTENTE!')</script>
<?
}
}
//Consulta sql
$csql=mysql_query("select * from ingreso order by nombre_usuario");
if (mysql_num_rows($csql)){

//Mostramos los registros
while ($row=@mysql_fetch_array($csql)){
if ($row["compañia"]==1){
$tipo=1;
}elseif($row["compañia"]==2){
$tipo=0;
}
$selecciona="'".$row["nombre_usuario"]."','".$row["rut_usuario"]."','".$row["clave_usuario"]."','".$tipo."'";
?>
<tr bordercolor="#CCCCCC">
<td bordercolor="#CCCCCC"><p style="cursor: pointer"><img src="select.bmp" border="0" onClick="seleccion(<?php echo $selecciona ?>);"></td>
<td bordercolor="#CCCCCC"><? echo $row["nombre_usuario"] ?></td>
<td bordercolor="#CCCCCC"><? echo $row["rut_usuario"] ?></td>
<td bordercolor="#CCCCCC"><? echo $row["compañia"] ?></td>
<td bordercolor="#CCCCCC">
<?php
if ($row["compañia"]==1){
echo "Consorcio";
}elseif($row["compañia"]==2){
echo "Royal";
}
echo "</td>";
}
}
echo "</table>";
echo "</form>";
}else{
//header("Location: index.htm");
}
?>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder