Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/02/2017, 18:27
Avatar de aviweb2015
aviweb2015
 
Fecha de Ingreso: abril-2016
Ubicación: venezuela
Mensajes: 215
Antigüedad: 8 años, 1 mes
Puntos: 1
UPDATE password= hash

hola amigos tengo este problemita cuando trato de actualizar el password:

Código PHP:
Ver original
  1. Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in C:


sera que mi UPDATE esta mal formulado, anexo el codigo y gracias de ante mano

Código PHP:
Ver original
  1. <?php
  2.  {
  3.  
  4.   if(isset($_POST['edita'])) {
  5.        
  6.  
  7.   if($_POST['password'] != $_POST['usuario_clave_conf']) {
  8.        
  9. echo "<div class='col s12 card-panel blue lighten-2 center'>
  10. <h5 class='black-text text-darken-2 center CONDENSED LIGHT5'>
  11. ¡ Ups Aviso: Las Contraseñas Ingresadas no Coinciden !
  12. </h5>
  13. </div>";
  14. header("refresh:5;mipass.php");
  15.  
  16.             }else {
  17.  
  18.  
  19.  
  20. $user = $_SESSION['user'];
  21. $password = $_POST['password'];
  22.  
  23. $sql = "UPDATE usuarios SET password= :password WHERE user= :user"; //Creamos la select
  24. $perfil = $DB_con->prepare($sql); //Preparamos la SELECT, de ésta manera evitamos SQL Injection
  25. $password= hash('sha256', $_POST['password']);
  26. $perfil->bindParam(':password',$password,PDO::PARAM_STR);
  27. $perfil->execute();
  28. if($sql) {
  29.  
  30.  
  31. header("refresh:5;home.php");
  32.  
  33. $mensaje = "<div class='col s12 card-panel cyan darken-4 center'>
  34. <h5 class='black-text text-darken-2 center CONDENSED LIGHT5'>¡ Exelente: Contraseña Actualizada Correctamente !</h5></div>";
  35.  
  36.                 }else {
  37.  
  38.  
  39.     header("refresh:5;mipass.php");
  40.  
  41. $mensaje = "<div class='col s12 card-panel blue lighten-2 center'>
  42. <h5 class='black-text text-darken-2 center CONDENSED LIGHT5'>
  43. ¡ Ups Aviso: No se Pudo Cambiar la Contraseña !
  44. </h5>
  45. </div>";
  46.  
  47.      
  48.                 }
  49.             }
  50.         }
  51.  
  52.         else {
  53.  
  54.  
  55.                 }
  56.     }
  57.  
  58.        
  59.    
  60.          
  61. ?>
__________________
yoclens avilan