X7ROOT File Manager
PHP:
7.2.34
OS:
Linux
User:
cp648411
Root
/
home2
/
cp648411
/
public_html
/
kainumber.com
/
include
📤 Upload
📝 New File
📁 New Folder
Close
Editing: login.php
<?php session_start(); require_once("../class/connectClass.php"); require_once("../class/view_Class.php"); require_once("../class/user_Class.php"); $view_db = new Viewdata; $User_db = new User; //$email = @$_POST["email"]; //$pass = @$_POST["password"]; $email = addslashes(trim($_POST['email'])); $pass= addslashes(trim($_POST['password'])); //$pass_md5 = md5(@$pass."legolas"); //$pass_md5 = md5($pass); $pass_md5 = $User_db->cus_pass($pass); $sql = array('table'=>'member','count'=>'count(id) AS count_id','where'=>"mail = '". $email ."' AND status = 1"); $view_sql = $view_db->view($sql); $row = $view_db->q($view_sql); $row["count_id"]; if($row["count_id"]) { $sql2 = array('table'=>'member','count'=>'count(id) AS count_id','where'=>"mail = '". $email ."' AND password = '". $pass_md5 ."'"); $view_sql2 = $view_db->view($sql2); $row2 = $view_db->q($view_sql2); if($row2["count_id"]) { $sql_id = array('table'=>'member','where'=>"mail = '".$email."' AND password = '".$pass_md5."'"); $viewid_sql = $view_db->view($sql_id); $row_id = $view_db->q($viewid_sql); $_SESSION["kai_login"] = 1; $_SESSION["kai_mail"] = $row_id["mail"]; $_SESSION["kai_id"] = $row_id["id"]; $_SESSION["kai_name"] = $row_id["name"]; $_SESSION["kai_lastname"] = $row_id["lastname"]; //print_r($_SESSION); //exit; ?><meta http-equiv="refresh" content="0;URL=../home/index.php" /><?php exit; } else { ?><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script> alert("ข้อมลู Username หรือ Password ไม่ถูกต้อง"); </script> <meta http-equiv="refresh" content="0;URL=../home/index.php"> <?php exit; } } else { ?><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script> alert("ข้อมลู Username หรือ Password ไม่ถูกต้อง"); </script> <meta http-equiv="refresh" content="0;URL=../home/index.php"> <?php exit; } ?>
Save
Cancel