Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- $hostname = "31.220.45.55";
- $username = "tomba";
- $password = "2aqu6u9ud";
- $database = "zadmin_tomba";
- $salt = "0fY417As1G";
- $_login = $_POST["us_login"];
- $_heslo = md5($_POST["us_heslo"].$salt);
- if($_login && $_heslo)
- {
- $databaseConnect = mysqli_connect($hostname, $username, $password, $database);
- $_login = mysqli_real_escape_string($databaseConnect,$_login);
- $_heslo = mysqli_real_escape_string($databaseConnect,$_heslo);
- $query = mysqli_query($databaseConnect, "SELECT user_id FROM main_users WHERE user_login = '$_login' and user_password = '$_heslo'");
- $check = mysqli_num_rows($query);
- if($check == 1){
- $user_data = mysqli_fetch_array($query);
- $_SESSION["user"]["id"] = $user_data["user_id"];
- $_SESSION["user"]["interval"] = "1200";
- $_SESSION["user"]["session_time"] = Time();
- $_SESSION["user"]["name"] = $_login;
- if(isset($_SESSION['user']['id'])){
- header("location:dashboard.php");
- }
- else{
- header("location:index.php?message=1");}
- }
- else{
- header("location:index.php?message=2");
- }
- }
- else{
- header("location:index.php?message=3");
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement