Domov
Klimat
Robot
Nevroni
Zmenek
Predstavitev
Izdelki
Html
Osnove
Napredno
Css
Osnove
Napredno
Javascript
Osnove
Tekst
Grafika
Napredno
Php
Osnove
Json
Podatki
Napredno
Python
Osnove
Jedro
Podatki
Bool
Splet
Uvoz
Napredno
C
Osnove
Tcp
Programi
Uvoz
Napredno
Orodja
PhpMyAdmin
Dokumenti
Sistem
Crontab
Nadgradi
PHP
Zmenek
Odpri
zmenek.php
Poglej
Nov zavihek
PHP Zmenek zmenek.php ?>
IsSMTP(); $mail->SMTPAuth = true; $mail->Host = "smtp.gmail.com"; $mail->Port = 587; $mail->Username = "bostjan.suhel@gmail.com"; $mail->Password = "tkgyudgtntrwnncv"; $mail->SMTPSecure = 'tls'; $mail->SetFrom($od, 'Boss'); //$mail->AddReplyTo("youraccount@gmail.com","Your name"); //$mail->addReplyTo('info@example.com', 'Information'); //$mail->addCC('cc@example.com'); //$mail->addBCC('bcc@example.com'); //$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments //$mail->isHTML(true); // Set email format to HTML //$mail->Body = 'This is the HTML message body
in bold!
'; $mail->Subject = $naslov; //$mail->AltBody = "Any message."; $mail->MsgHTML($sporocilo); $mail->AddAddress($za); if(!$mail->Send()) { return 0; } else { return 1; } } */ session_start(); function geslo($length=10){return substr(str_shuffle(str_repeat($x='0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', ceil($length/strlen($x)) )),1,$length);} $link = new mysqli("localhost", "pi", "raspberry","test"); if ($link->connect_error) die("Napaka: " . $link->connect_error); if(isset($_POST['potrdids'])){$email=$_SESSION['gmail'];$vzdevek=$_POST['vzdevek'];$spol=$_POST['spol'];$starost=$_POST['starost']; $podatki = $link->query("update uporabnik set vzdevek='$vzdevek', spol='$spol', starost='$starost' where email='$email'");} if(isset($_POST['izpis'])){session_destroy();$_SESSION["vpisan"]="NE";} if(isset($_POST['vpis'])){$email=$_POST['email'];$geslo=$_POST['geslo']; $podatki = $link->query("select * from uporabnik where email='$email'");$vrstica = $podatki->fetch_assoc(); if($vrstica["geslo"]==$geslo and $vrstica["email"]==$email and strlen($vrstica["email"])>=2){ if($vrstica["status"]=="U"){$vrstica["status"]="P";$status="P"; $podatki = $link->query("update uporabnik set email='$email',geslo='$geslo',status='$status' where email='$email'"); } $_SESSION["status"]=$vrstica["status"];$_SESSION["gmail"]=$email;$_SESSION["vpisan"]="DA";} else $_SESSION["vpisan"]="NAPAKA"; } if(isset($_POST['pozabilgeslo'])){ $email=$_POST['email'];$_SESSION["gmail"]=$_POST['email']; $podatki = $link->query("select * from uporabnik where email='$email'");$vrstica = $podatki->fetch_assoc(); $geslo=$vrstica["geslo"]; if(filter_var($email, FILTER_VALIDATE_EMAIL)){ $gm=explode('@',$email); /*sendmail("bostjan.suhel@gmail.com",$email,$geslo,"Poslano Geslo");*/ $_SESSION["vpisan"]="GESLO";} else $_SESSION["vpisan"]="NAPAKA1"; } if(isset($_POST['novogeslo'])) { $geslo=$_POST['geslo'];$email=$_POST['email'];$_SESSION["gmail"]=$email; $podatki = $link->query("select * from uporabnik where email='$email'");$vrstica = $podatki->fetch_assoc(); if($vrstica["geslo"]==$geslo and $_POST['novogeslos']==$_POST['novogeslosp'] and strlen($_POST['novogeslos'])>=6) { $geslo=$_POST['novogeslos'];$status=$vrstica["status"]; $podatki = $link->query("update uporabnik set email='$email',geslo='$geslo',status='$status' where email='$email'"); if(filter_var($email, FILTER_VALIDATE_EMAIL)){ /*sendmail("bostjan.suhel@gmail.com",$email,$geslo,"Novo Geslo");*/ $_SESSION["vpisan"]="GESLO";} } else $_SESSION["vpisan"]="NAPAKA2"; } if(isset($_POST['prvic'])!=0) { $status="U";$email=$_POST['email'];$_SESSION["gmail"]=$email; if(filter_var($email, FILTER_VALIDATE_EMAIL)) { $geslo=geslo(); $mysql="insert into uporabnik (email, geslo, status) values ('$email','$geslo','$status')"; if($link->query($mysql) === TRUE) { /*sendmail("bostjan.suhel@gmail.com",$email,$geslo,"Geslo");*/ $_SESSION["vpisan"]="GESLO"; } else $_SESSION["vpisan"]="PODVOJEN"; } else $_SESSION["vpisan"]="NAPAKA1"; } if(isset($_POST['novogesloda']))$_SESSION["vpisan"]="NOVOGESLO"; if(isset($_POST['prvicaligesloda']))$_SESSION["vpisan"]="PRVICALIGESLO"; if(isset($_POST['vpisda']))$_SESSION["vpisan"]="VPIS"; echo "
\n"; echo "
\n
\n"; session_start(); if(isset($_POST['domov'])) $_SESSION["meni"]=""; if(isset($_POST['test_stran1'])) $_SESSION["meni"]="stran1"; if(isset($_POST['test_stran2'])) $_SESSION["meni"]="stran2"; if(isset($_POST['test_nadzornik'])) $_SESSION["meni"]="nadzornik"; if(isset($_POST['test_upravljalec'])) $_SESSION["meni"]="upravljalec"; if(isset($_POST['test_uporabnik'])) $_SESSION["meni"]="uporabnik"; if($_SESSION["vpisan"]=="DA"){$gm=explode('@',$_SESSION["gmail"]);echo $gm[0]."
\n"; #izpise gmail brez @ in domene echo "
Izpis
\n"; if($_SESSION["status"]=="A") {echo "
Stran1
\n
Stran2
\n
Nadzornik
\n
Upravljalec
\n";} elseif($_SESSION["status"]=="M"){echo "
Stran1
\n
Stran2
\n
Upravljalec
\n";} elseif($_SESSION["status"]=="P"){echo "
Stran1
\n";} elseif($_SESSION["status"]=="U"){echo "";} echo "
Uporabnik
\n"; } else {$_SESSION["meni"]=""; if($_SESSION["vpisan"]=="" or $_SESSION["vpisan"]=="NOVOGESLO" or $_SESSION["vpisan"]=="PRVICALIGESLO" or $_SESSION["vpisan"]=="VPIS"){ echo "Email:
\n"; if($_SESSION["vpisan"]!="PRVICALIGESLO") echo "Geslo:
\n"; if($_SESSION["vpisan"]=="NOVOGESLO") echo "Novo:
\nPotrdi:
\n"; echo "
\n"; if($_SESSION["vpisan"]=="" or $_SESSION["vpisan"]=="VPIS") echo "
Vpis
\n
Prvič / Geslo
\n
Novo Geslo
\n"; if($_SESSION["vpisan"]=="NOVOGESLO") echo "
Novo Geslo
\n
Vpis
\n
Prvič / Geslo
\n"; if($_SESSION["vpisan"]=="PRVICALIGESLO") echo "
Prvič
\n
Geslo
\n
Vpis
\n
Novo Geslo
\n"; } if($_SESSION["vpisan"]=="NAPAKA"){$_SESSION["vpisan"]=""; echo 'Email ali geslo narobe!
';} if($_SESSION["vpisan"]=="NAPAKA1"){$_SESSION["vpisan"]=""; echo 'Email narobe!
';} if($_SESSION["vpisan"]=="NAPAKA2"){$_SESSION["vpisan"]=""; echo 'Email ali geslo narobe!
Dolžina gesla najmanj 6!
';} /*if($_SESSION["vpisan"]=="GESLO"){$_SESSION["vpisan"]=""; $gm=explode('@',$email); echo 'Geslo poslano na '.$gm[0].'
';}*/ if($_SESSION["vpisan"]=="GESLO"){$_SESSION["vpisan"]=""; $gm=explode('@',$email); echo $geslo.'
';} if($_SESSION["vpisan"]=="PODVOJEN"){$_SESSION["vpisan"]=""; echo 'Email že obstaja
';} } echo "
\n
\n"; include 'stran.php'; $link->close(); echo"
Zmenek
2024
\n\n"; ?>