daily pastebin goal
42%
SHARE
TWEET

Untitled

a guest Dec 29th, 2016 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.     ob_start();
  3.     require_once($_SERVER['DOCUMENT_ROOT'] .'/inc/core.php');
  4.     require_once($_SERVER['DOCUMENT_ROOT'] .'/inc/sessione.php');
  5.     require_once('templates/header.php');
  6.     /* Filtro la var in ingresso */
  7.     if($_GET['edit'] != true) {
  8.         $nomeutente = $system->Filtro($_POST['modificami']);
  9.         $query = $connessione->connessioneDb()->prepare("SELECT * FROM users WHERE username = :nomeutente");
  10.         $query->execute(array(
  11.                              "nomeutente" => $nomeutente,
  12.                              ));
  13.         $utente_conta = $query->rowCount();
  14.         if($utente_conta > 0) {
  15.             $utente = $query->fetch(PDO::FETCH_ASSOC);
  16.         } else {
  17.             echo "Utente non trovato";
  18.             exit;
  19.         }
  20.     }
  21.    
  22.     if($_GET['edit'] == true) {
  23.         $nomeUtente = $system->Filtro($_POST['nomeutente']);
  24.         $passwordutente = $system->Filtro($_POST['password']);
  25.         $query = $connessione->connessioneDb()->prepare("UPDATE users SET password = :password WHERE username = '".$nomeUtente."'");
  26.         $query->execute(array(
  27.                              "password" => sha1($passwordUtente),
  28.                              ));
  29.         header("Location: pass.php");
  30.     }
  31. ?>
  32. <html>
  33.     <body>
  34.     <div id="badge">
  35.     <div id="titolo">
  36.         <h2> Stai modificando la password di <?php echo $utente['username']; ?> </h2>
  37.     </div>
  38.     <form action="?edit=true" method="post" style="    
  39.                                                     font-size: 15px;
  40.                                                     color: white;
  41.                                                     font-family: sans-serif;">
  42.     Username: <br>
  43.     <input type="text" disabled class="inputedit" name="nomeutente" value="<?php echo $utente['username'];?>"/><br>
  44.     Password: <br>
  45.     <input type="text" class="inputedit" name="password" value="Nuova password..."/><br>
  46.     <input type="submit" value="Modifica" class="editaok"/>
  47.     </form>
  48.     </div>
  49.     </body>
  50. </html>
  51. <?php
  52. ob_end_flush();
  53. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top