Ver Mensaje Individual
  #4 (permalink)  
Antiguo 19/03/2013, 08:44
snakeskander
 
Fecha de Ingreso: marzo-2013
Mensajes: 4
Antigüedad: 12 años
Puntos: 0
Respuesta: Codigo para cambiar contraseña problema

Código PHP:
<?php
include ("Conexion.php");
session_start();{
$ide=$_SESSION['login'];
$consulta "select * from usuario where id = '$ide' ";
$sentencia mysql_query($consulta,$con);
while (
$rs=mysql_fetch_array($sentencia)){
$rut $rs["rut"];
$nombre$rs["usunom"];
$cargo=$rs["cargo"];
$direccion=$rs["usudir"];
$fono $rs["usufon"];
$mail$rs["usumail"];
}}

if (isset(
$_post["btnedpwd"])){
$txtcontrao=$_POST["txtcontrao"];
$txtcontra1=$_post["txtcontra1"];
if (
$txtcontrao=="txtcontrao"){
    
$eli "delete contra from usuario where contra = '$txtcontrao'";
    
$sentencia mysql_query($eli,$con);
    while (
$rs=mysql_fetch_array($sentencia)){}
    
$insert="insert into usuario(contra) values ('$txtcontra1')";}
else{
    echo 
"Contraseñas Incorrectas";
}}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 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=utf-8" />
<title>Documento sin título</title>
</head>

<body bgcolor="#FF6600">
<div align="center">
<table width="322" height="213" border="1">
    <tr>
      <td height="23" colspan="2"><div align="center">MIS DATOS </div></td>
    </tr>
    <tr>
    
      <td height="23">ID</td>
      <td height="23"><form id="form4" name="form4" method="post" action="">
        <label for="textfield"></label>
        <input name="ide" type="text" id="ident" value="<?php echo $ide?> " readonly="readonly" />
      </form>
      
    <tr>
      <td height="23">RUT</td>
      <td height="23"><form id="form5" name="form5" method="post" action="">
        <label for="textfield2"></label>
        <input name="rut" type="text" id="rut" value="<?php echo $rut;?>" readonly="readonly" />
      </form></td>
    </tr>
    <tr>
      <td height="23">NOMBRE</td>
      <td height="23"><form id="form6" name="form6" method="post" action="">
        <label for="textfield3"></label>
        <input name="name" type="text" id="nombre" value= "<?php echo $nombre;?> "readonly="readonly" />
      </form></td>
    </tr>
    <tr>
      <td height="23">CARGO</td>
      <td height="23"><form id="form7" name="form7" method="post" action="">
        <label for="textfield4"></label>
        <input name="cargo" type="text" id="cargo" value="<?php 
echo $cargo;?>" readonly="readonly"/>
      </form></td>
    </tr>
    <tr>
      <td width="162" height="26">DIRECCION</td>
      <td width="144"><form id="form8" name="form8" method="post" action="">
        <label for="textfield5"></label>
        <input name="direccion" type="text" id="vivir" value="<?php echo $direccion;?> " readonly="readonly" />
      </form></td>
    </tr>
    <tr>
      <td height="26">FONO</td>
      <td><form id="form9" name="form9" method="post" action="">
        <label for="textfield6"></label>
        <input name="fono" type="text" id="number" value="<?php echo $fono;?>" readonly="readonly" />
      </form></td>
    </tr>
    <tr>
      <td height="26">E-MAIL</td>
      <td><form id="form10" name="form10" method="post" action="">
        <label for="textfield7"></label>
        <input name="mail" type="text" id="correo" value="<?php 
echo $mail;?>" readonly="readonly" />
      </form></td>
    </tr>
  </table>
<p>&nbsp;</p>
</div>
<div align="center">
  <table width="319" border="1">
    <tr>
      <td colspan="2"><div align="center">CAMBIO DE CLAVE</div></td>
    </tr>
    <tr>
      <td width="159" height="26">CLAVE ANTERIOR</td>
      <td width="144"><form id="form1" name="form1" method="post" action="">
      <label for="txtcontrao"></label>
      <input type="password" name="txtcontrao" id="txtcontrao"/>
    </form>      
    </tr>
    <tr>
      <td height="26">NUEVA CLAVE</td>
      <td><form id="form2" name="form2" method="post" action="">
      <label for="txtcontra1"></label>
      <input type="password" name="txtcontra1" id="txtcontra1" />
      </form></td>
    </tr>
  </table>
</div>
<p align="center">
  <input type="submit" name="btnedpwd" id="btnedpwd" value="Cambiar Contraseña" />
</p>
<p align="center"><A href="MenuUsuario.php"><i>VOLVER</i></A></p> 
</body>
</html>
esto es lo que tengo