PageRenderTime 69ms CodeModel.GetById 28ms RepoModel.GetById 1ms app.codeStats 0ms

/home.php

https://bitbucket.org/amorello/changeover
PHP | 49 lines | 26 code | 23 blank | 0 comment | 3 complexity | eeb007c5c6f16f02df9716fc94657362 MD5 | raw file
  1. <?php
  2. session_start();
  3. include 'CSS/templateTop.html';
  4. require_once 'login.php';
  5. $ID = $_POST['utente'];
  6. if ($ID ==0)
  7. {
  8. echo "Errore: non è stato selezionato nessun utente!";
  9. }else
  10. {
  11. $query = "SELECT pwd FROM utenti WHERE ID=$ID ";
  12. $result = mysql_query($query);
  13. if (!$result) die ("Database access failed: " . mysql_error());
  14. $row = mysql_fetch_row($result);
  15. $pwd = $row[0];
  16. $pwdinserita = (isset($_POST['pwdinserita'])) ? $_POST['pwdinserita'] : '';
  17. if (crypt($pwdinserita, $pwd) === $pwd)
  18. {
  19. $_SESSION['changeover_IDutente']=$ID;
  20. header("location: changeover.php");
  21. }else{
  22. echo "Errore: password errata!";
  23. }
  24. }
  25. include 'CSS/templateEnd.html';
  26. ?>