-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocess.php
More file actions
28 lines (20 loc) · 786 Bytes
/
process.php
File metadata and controls
28 lines (20 loc) · 786 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
<?php
$host = "localhost";
$port = "5432";
$dbname = "login";
$user = "postgres";
$password = "8435";
$connection_string = "host={$host} port={$port} dbname={$dbname} user={$user} password={$password} ";
$dbconn = pg_connect($connection_string) or die('Could not connect: ' . pg_last_error()) ;
if(isset($_POST['submit'])&&!empty($_POST['submit'])){
$hashpassword = md5($_POST['password']);
$sql ="select *from public.users where email = '".pg_escape_string($_POST['user'])."' and password ='".$hashpassword."'";
$data = pg_query($dbconn,$sql);
$login_check = pg_num_rows($data);
if($login_check > 0){
header('Location: index.html');
}else{
echo "Invalid Details";
}
}
?>