-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
39 lines (30 loc) · 936 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
require_once("config.php");
$email=$_COOKIE["u"];
$pass=$_COOKIE["t"];
function decryp($str,$pwd){$pwd=base64_encode($pwd);$str=base64_decode($str);$enc_chr="";$enc_str="";$i=0;while($i<strlen($str)){for($j=0;$j<strlen($pwd);$j++){$enc_chr=chr(ord($str[$i])^ord($pwd[$j]));$enc_str.=$enc_chr;$i++;if($i>=strlen($str))break;}}return base64_decode($enc_str);}
function hel($email,$conn){
$qry="SELECT * FROM members WHERE email = '".$email."'";
$result=mysqli_query($conn,$qry);
if($result) {
if(mysqli_num_rows($result) == 1) {
//Login Successful
$row = mysqli_fetch_assoc($result);
return $row;
}else {
//Login failed
return null;
}
}
}
$cook=hel(base64_decode($email),$conn);
if (isset($cook)){
if ($cook["password"] == md5(decryp($pass,$cook["cook"]))){
require_once("dashboard.php");
}else {
require_once("main.html");
}}else{
require_once("main.html");
}
?>
<!-- Tarik Bakir :\) --\>