-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfiguration.php
58 lines (46 loc) · 1.07 KB
/
configuration.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname="chathub";
// Create connection
$conn = mysqli_connect($servername, $username, $password,$dbname);
//$db_name = "chat_db";
//$conn1 = new mysqli($servername,$username,$password,$db_name,true);
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
else
//echo "Connection successfully done....Please wait while you are redirected...";
session_start();
function test_input($data)
{
$data=trim($data);
$data=stripslashes($data);
$data=htmlspecialchars($data);
$data=htmlspecialchars($data,ENT_QUOTES);
return $data;
}
function formatDate($date)
{
return date('g:i a', strtotime($date));
}
function hashing($password,$email)
{
$salt=sha1($email);
$password1=md5(htmlspecialchars($password));
$pass=crypt($password1,$salt);
$pass1=$pass.'1437';
$hashpass=hash("sha512",$pass1);
return $hashpass;
}
function hashing1($email)
{
$salt=sha1($email);
$pass=$salt.'1437';
$hashpass=hash("sha512",$pass);
return $hashpass;
}
?>