Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(E_ERROR);
- session_start();
- require_once("class/Oracle.php");
- if (isset($_POST['logout'])) {
- unset($_SESSION);
- session_destroy();
- }
- $atts = array('username' => "", 'password' => null);
- if (isset($_SESSION['username']) && isset($_SESSION['password'])) {
- echo 'testik';
- $_SESSION['username'] = $jmeno;
- $_SESSION['password'] = $heslo;
- echo $_SESSION['username'];
- $stid = $db->parseAndExecute("SELECT * FROM USERSS where username='" . $_SESSION['username'] . "'
- AND password = MD5HASH('" . $_SESSION['password'] . "')");
- oci_execute($stid);
- while (($row = oci_fetch_array($stid, OCI_BOTH))) {
- //echo 'test';
- if (count($row) > 0) {
- $dbusername = $row['USERNAME'];
- $dbpassword = $row['PASSWORD'];
- $dbgroup_id = $row['ADMIN'];
- $dbemail = $row['EMAIL'];
- echo $dbusername . " ";
- echo $dbpassword . " ";
- }
- }
- if ($username == $dbusername) {
- echo 'test22';
- session_start();
- $_SESSION['admin'] = $dbgroup_id;
- $_SESSION['session_username'] = $username;
- $_SESSION['user_email'] = $dbemail;
- echo $username;
- } else {
- $messageLogin = 'Uzivatel s takovym jmenem neexistuje';
- }
- }
- if (isset($_POST['reset'])) {
- unset($atts['username']);
- unset($atts['password']);
- $atts['username'] = "";
- $atts['password'] = "";
- }
- if ($_SESSION['admin'] == 'yes') {
- echo 'jsi admin';
- } else if ($_SESSION['admin'] == 'no') {
- echo 'jsi user';
- } else {
- echo 'jsi trumpeta';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement