Ver Mensaje Individual
  #3 (permalink)  
Antiguo 03/10/2008, 15:57
Avatar de hoberwilly
hoberwilly
 
Fecha de Ingreso: julio-2008
Ubicación: Lima - Perú
Mensajes: 769
Antigüedad: 16 años, 8 meses
Puntos: 2
Respuesta: Acceso de usuario para actualización de datos

Oka Jaronu,
esto es lo k avanze
login.html
---------------
<form name="form1" method="post" action="login.php">
<h1>INGRESE D.N.I.</h1>
<p>
<input name="dni" type="text" id="dni">
</p>
<p>
<input type="submit" name="submit" value="ENVIAR">
</p>
</form>

login.php
------------
<?php
include('conec.php');
conectarse();

//Preguntaremos si se han enviado ya las variables necesarias
if(isset($_POST["dni"])) {

$dni=$_POST["dni"];

// Hay campos en blanco
if($dni==NULL) {
echo "<h2>Por favor llenar los campos que son obligatorios!</h2>";
}
else{
// Comprobamos si el nombre de usuario o la cuenta de correo ya existían
$checkuser=mysql_query("SELECT aludni FROM datos WHERE aludni='$dni'");
$username_exist=mysql_num_rows($checkuser);
if($username_exist>0){
header("location: editar.php");
}
}
}
?>

Sólo k aquí está el problema, al ingresar correctamente uno de los datos del DNI y así actualizar en la ventana de editar.php me muestran los campos en blanco????
editar.php
-------------
<?
include("conec.php");
conectarse();
$sql="select * from datos where alucod=".$_GET['id']."";
$registro=mysql_query($sql);
$fila=mysql_fetch_array($registro);
?>

<html>
<head>
<title>Editando Registro</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>

<form name="form1" method="post" action="actualizar.php?id=<?php echo $fila["alucod"];?>">
<table>
<tr bgcolor="#003366">
<td colspan="2">Edición de Datos</td>
</tr>
<tr>
<td><font size="2"><strong>Paterno</strong></font></td>
<td><font size="2">&nbsp;
<input name="paterno" type="text" id="paterno" value="<?php echo $fila["alupat"]?>">
</font></td>
</tr>
<tr>
<td colspan="2" ><input type="submit" name="Submit" value="Actualizar"></td>
</tr>
</table>
</form>
</body>
</html>

Ayudame por favor