-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConnect.php
More file actions
32 lines (26 loc) · 939 Bytes
/
Connect.php
File metadata and controls
32 lines (26 loc) · 939 Bytes
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
<?php
class Connect {
private $connection;
private $cryptPass;
//MAIN
function __construct(){
$this->connect();
}
function connect(){
$this->connection = new PDO('mysql:host=orfarile;dbname=orfarile', 'root', '');
}
function createUser($login, $password){
$this->cryptPass = ($login.$password);
$this->connection->query("INSERT INTO users(user_login, user_password) VALUES ('".$login."', '". md5($this->cryptPass.salt) ."')");
}
//PRE-RELEASE
//TEST A
function checkUser($login, $password){
$this->cryptPass = ($login.$password);
$temp = $this->connection->query("SELECT * FROM users WHERE user_login like '".$login."' AND user_password like '".md5($this->cryptPass.salt)."' ;");
while ($row = $temp->fetch()){
print_r ("login = ".$row['user_login']."<br> password = ".$row['user_password']);
}
}
}
?>