-
Notifications
You must be signed in to change notification settings - Fork 0
/
cp.php
109 lines (80 loc) · 2.28 KB
/
cp.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<!--
<?php
$conn=mysqli_connect("localhost","root","","home");
if(!$conn){
die("connection failed".mysqli_connect_error());
}
echo "connected succesfully <br>";
if(isset($_POST['submit'])){
$email =$_POST['email'];
$password=$_POST['password'];
// $loginchk=" select * from cpsign where email='$email' and password='$password' ";
// $result=mysqli_query($conn,$loginchk);
// $count-mysqli_num_rows($result);
// if($count>0){
// echo "LOGIN SUCCESFUULY";
// }
// else{
// echo"INVALID USERNAME OR PASSWORD";
// }
$sql= "SELECT * FROM cpsign WHERE email = '$email' AND password = '$password' ";
$result = mysqli_query($conn,$sql);
$check = mysqli_fetch_array($result);
if(isset($check)){
echo 'LOGIN SUCCESFUULY';
echo "Hello $email";
}else{
echo 'INVALID USERNAME OR PASSWORD';
}
}
// $query="INSERT INTO cpform(email,password)
// VALUES('$email','$password')";
// $data=mysqli_query($conn,$query);
// if($data){
// echo"Data inserted successfully";
// }
// else{
// echo"Data insertion failed";
// }
?> -->
<?php
$conn=mysqli_connect("localhost","root","","home");
if(!$conn){
die("connection failed".mysqli_connect_error());
}
// echo "connected succesfully <br>";
if(isset($_POST['submit'])){
$email =$_POST['email'];
$password=$_POST['password'];
$sql= "SELECT * FROM cpsign WHERE email = '$email' AND password = '$password' ";
$result = mysqli_query($conn,$sql);
$check = mysqli_fetch_array($result);
if(isset($check))
{
echo ' <h1>LOGIN SUCCSSFULLY <br></h1>';
echo "<h2>Hello $email </h2>";
}else{
echo '<h1>INVALID USERNAME OR PASSWORD</h1>';
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
body{
margin: 0px;
padding: 0px;
background-color: #caf6bf;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}
</style>
</head>
<body>
<a href="ex.html"><button>HOME</button></a>
</body>
</html>