SHARE
TWEET

Untitled

a guest Mar 20th, 2017 114 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function SpremeniGeslo(){
  2.   if (isset($_POST['mojmojGumb'])){
  3.     echo "<br>";
  4.     $password = strip_tags($_POST['trenutnogeslo']);
  5.     $password1 = strip_tags($_POST['newpassword1']);
  6.     $password2 = strip_tags($_POST['newpassword2']);
  7.     $link=open_database_connection();
  8.     $kodirano_geslo = sha1($password);
  9.     $novo_kodirano_geslo = sha1($password1);
  10.     $abc = $_SESSION['mojamojaSeja'];
  11.     $preverisql = mysqli_query($link,"SELECT username, password FROM registracija WHERE username='$abc' AND password='$kodirano_geslo'");
  12.  
  13.     if ($password == "" || $password1 == "" || $password2 == ""){
  14.       echo "Niste izpolnili vseh podatkov";
  15.     } else {
  16.       if ($password == $password1){
  17.         echo "Novo geslo ne sme biti enako kot staro geslo";
  18.       } else {
  19.         if ($password1 !== $password2){
  20.           echo "Novi gesli se ne ujemata";
  21.         } else {
  22.           if (mysqli_num_rows($preverisql) == 0){
  23.             echo "Vnesli ste napacno geslo";
  24.         } else {
  25.           if ($password < 8){
  26.             echo "Geslo mora biti vsaj 8 znakov dolgo";
  27.           } else {
  28.           mysqli_query($link,"UPDATE registracija SET password='$novo_kodirano_geslo' WHERE username='$abc'");
  29.           echo "Geslo uspeŇ°no spremenjeno";
  30.         }
  31.       }
  32.       }
  33. }
  34. }
  35. }
  36. }
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