Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include('../system/libraries/helpers.php');
- include('../system/libraries/crud_pdo.php');
- session_start();
- $username = $helpers->sanatizeItem($_POST['username'], "string");
- $password = $helpers->encrypt_($helpers->sanatizeItem($_POST['password'], "string"));
- if ($helpers->sanatizeItem(@$_POST['login-mahasiswa'], "string")) {
- $data = array(
- 'mahasiswa_nim' => $username,
- 'mahasiswa_password' => $password
- );
- $s = $crud->check_exist('mahasiswa', $data);
- print_r($s);
- exit();
- if ($s == true) {
- foreach($s as $val) {
- $_SESSION['id'] = $val['mahasiswa_nim'];
- $_SESSION['name'] = $val['mahasiswa_name'];
- $_SESSION['email'] = $val['mahasiswa_email'];
- }
- $helpers->redirect('../template.php');
- } else {
- $helpers->redirect('../index.php?info=failed');
- }
- } else if ($helpers->sanatizeItem(@$_POST['login-kajur'], "string")) {
- $data = array(
- 'kajur_nip' => $username,
- 'kajur_password' => $password
- );
- $s = $crud->check_exist('kajur', $data);
- if ($s == true) {
- } else {
- $helpers->redirect('../index.php?info=failed');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement