-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlog.php
52 lines (37 loc) · 939 Bytes
/
log.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
<?php
session_start();
include"db_conn.php";
if(isset($_POST['mob']) && isset($_POST['pas'])){
function validate($data){
$data=trim($data);
$data=stripslashes($data);
$data=htmlspecialchars($data);
return $data;
}
$mob=validate($_POST['mob']);
$pas=validate($_POST['pas']);
if(empty($mob)){
header("Location: login.php?error=Mobile Number is required");
exit();
}else if(empty($pas)){
header("Location: login.php?error=Password is required");
exit();
}else{
$sql="select mobno,password from cust where mobno='$mob' and password='$pas' ";
$result=pg_query($conn,$sql);
$r=pg_fetch_array($result,$row=null);
print_r($r);
if($r==NULL){
header("Location: login.php?error=Invalid Mobile Number or Password");
exit();
}else{
$_SESSION['mobno']=$mob;
header("Location: main.php");
exit();
}
}
}else{
header("Location: login.php?error");
exit();
}
?>