algo asi:
index.php
Código php:
Ver original<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title
>Documento
sin t
í
;tulo
</title
> <style type="text/css">
<!--
.Estilo1 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-weight: bold;
}
.Estilo2 {
font-size: 24pt;
font-weight: bold;
font-family: Arial, Helvetica, sans-serif;
}
-->
</style>
</head>
<body>
<table width="890" border="0" align="center">
<tr>
<td> </td>
<td><div align="center"><span class="Estilo2">BUSCAR CUENTA A MODIFICAR</span></div></td>
<td> </td>
</tr>
</table>
<br /><br />
<form id="form1" name="form1" method="post" action="mostrar.php">
<table width="360" border="1" align="center">
<tr>
<td width="167"><div align="right" class="Estilo1">clave </div></td>
<td width="177"><label>
<input name="alias" type="text" id="alias" />
</label></td>
</tr>
<tr>
<td align="right">
<input type="submit" name="Submit" value="BUSCAR" />
</td>
<td><label>
<input type="button" name="Submit2" value="CANCELAR" onclick="document.location='inicio.php'"/>
</label></td>
</tr>
</table>
</form>
</body>
</html>
mostrar.php
Código php:
Ver original<?php
include "conexion.php";
$consecutivo=$_POST['alias'];
conectar();
$bus=mysql_query("select *from tabla where consecutivo='$consecutivo'"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title></title>
<script>
function validar(formulario)
{
if(formulario.nombre.value=='')
{
alert("LLENAR CAMPOS NECESARIOS\n-NOMBRE");
formulario.nombre.focus();
return false;
}
if(formulario.password.value=='')
{
alert("LLENAR CAMPOS NECESARIOS\n-");
formulario.password.focus();
return false;
}
return true;
}
</script>
<style type="text/css">
<!--
.Estilo1 {
font-size: 24pt;
font-weight: bold;
font-family: Arial, Helvetica, sans-serif;
}
.Estilo2 {font-family: Verdana, Arial, Helvetica, sans-serif}
-->
</style>
</head>
<body onload="form1.nombre.focus()">
<div align="center"><span class="Estilo1">MODIFICAR DATOS</span></div>
<form onsubmit="return validar(this)" id="form1" name="form1" method="post" action="modificar.php">
<p> </p>
<table width="200" border="1" align="center">
<tr>
<td><span class="Estilo2"><strong>
<label> </label>
</strong>
<label></label>
</span> <label><div align="right" class="Estilo2"><strong>NOMBRE:</strong></div>
</label></td>
<td><input name="nombre" type="text" id="nombre" style="text-transform:uppercase" value="<?php echo $cons['nombre'];?>" size="50" maxlength="50"/></td>
</tr>
<tr>
<td><div align="right" class="Estilo2"><strong>alias:
</strong></div>
<span class="Estilo2"><strong>
<label></label>
</strong></span></td>
<td><div style="text-transform:uppercase"><?php echo $cons['alias'];?></div><input name="alias" type="hidden" id="alias" style="text-transform:uppercase" value="<?php echo $cons['consecutivo']; ?>" size="30" maxlength="30" /></td>
</tr>
<tr>
<td><div align="right" class="Estilo2"><strong>PASSWORD:
</strong></div>
<span class="Estilo2"><strong>
<label></label>
</strong></span></td>
<td><input name="dato" type="text" id="password" value="<?php echo $cons['dato'];?>" size="30" maxlength="30" /></td>
</tr>
</table>
<p> </p>
<table width="200" border="0" align="center">
<tr>
<td align="right">
<input type="submit" name="Submit" value="ACTUALIZAR" />
</td>
<td><label>
<input type="button" name="Submit2" value="CANCELAR" onclick="document.location='inicio.php'"/>
</label></td>
</tr>
</table>
<p> </p>
</form>
</body>
</html>
modificar.php
Código php:
Ver original<?php
include "conexion.php";
$id=$_POST['alias'];
$nombre=$_POST['nombre'];
$dato=$_POST['dato'];
conectar();
mysql_query("UPDATE password SET nombre='$nombre',dato='$dato' WHERE consecutivo='$id'"); echo '<script>alert("DATOS ACTUALIZADOS CON EXITO");</script>';
echo '<script>document.location="otra_pag.php";</script>';
?>
conexion.php
Código php:
Ver original<?php
function conectar()
{
}
function desconectar()
{
}
?>
solo adecualo alos tu base de datos, espero te ayude, suerte