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'])) {
- echo 'test';
- unset($_SESSION);
- session_destroy();
- }
- $atts = array('username' => "", 'password' => null);
- if (empty($_POST['login'])) {
- echo 'test';
- if (!empty($_POST['username']) && !empty($_POST['password'])) {
- $jmeno = $_POST['username'];
- $heslo = $_POST['password'];
- $stid = $db->parseAndExecute("SELECT username,password, admin, email FROM USERSS "
- . "WHERE username='" . $_POST['username'] . "'
- AND pswd = MD5HASH('" . $_POST['password'] . "')");
- oci_execute($stid);
- while (($row = oci_fetch_array($stid, OCI_BOTH))) {
- if (count($row) > 0) {
- $dbusername = $row['USERNAME'];
- $dbpassword = $row['PASSWORD'];
- $dbgroup_id = $row['ADMIN'];
- $dbemail = $row['EMAIL'];
- }
- }
- if ($username == $dbusername) {
- session_start();
- $_SESSION['admin'] = $dbgroup_id;
- $_SESSION['session_username'] = $username;
- $_SESSION['user_email'] = $dbemail;
- } else {
- $messageLogin = 'Uzivatel s takovym jmenem neexistuje';
- }
- } else {
- $message = "All fields are required!";
- }
- }
- var_dump($_POST['login']);
- if (isset($_POST['reset'])) {
- unset($atts['username']);
- unset($atts['password']);
- $atts['username'] = "";
- $atts['password'] = "";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement