-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpt1.php
More file actions
120 lines (108 loc) · 3.47 KB
/
Copy pathpt1.php
File metadata and controls
120 lines (108 loc) · 3.47 KB
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
110
111
112
113
114
115
116
117
118
119
120
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Log In</title>
<link rel="icon" type="image/png" href="CSS/number-8.png">
<link rel="stylesheet" href="CSS/pt1.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Lovers+Quarrel&family=Teachers:ital,wght@0,400..800;1,400..800&display=swap" rel="stylesheet">
</head>
<body>
<header>
Luigi's
</header>
<main>
<div class="first">
<div id="f1">
<h1 id="fff">Log In</h1>
<form method="post">
<label for="mail">E-mail</label>
<br>
<input type="mail" name="mail" class="b1">
<br>
<br>
<br>
<label for="pass">Password</label>
<br>
<input type="password" name="pass" class="b1">
<br>
<br>
<br>
<br>
<button id="one" name="log">Log In</button>
<br>
<br>
<br>
</form>
</div>
<div class="sec">
<h3 id="two">Keep yourself up to date with the latest deals and offers<br>Discounts, Promo codes, Giveaways<br>And many more</h3>
<br>
<h5 id="tt">So, what are you waiting for?<br>Subscribe to our newsletter</h5>
<form method="post">
<input type="email" id="b2" name="em1">
<br>
<br>
<br>
<button id="bu3" name="si">SUBMIT</button>
<br>
<br>
<br>
<br>
</form>
</div>
</form>
</div>
</main>
</body>
</html>
<?php
include("Database/db_user.php");
$sql="SELECT *FROM users;";
$s="SELECT *FROM subs";
$res=mysqli_query($conn,$sql);
$su=mysqli_query($conn,$s);
if (isset($_POST['mail']) || isset($_POST['pass'])) {
$tm=$_POST["mail"];
$to=$_POST["pass"];
}
if (isset($_POST["em1"])) {
$tz=$_POST["em1"];
}
$n=0;
if (isset($_POST["si"])) {
while ($row=mysqli_fetch_assoc($su)) {
$co=$row['sub'];
if ($co==$tz) {
$n=1;
}
}
if ($n==0) {
$cc="INSERT INTO subs (sub)
VALUES ('$tz')";
mysqli_query($conn, $cc);
}
}
if (isset($_POST["log"])) {
while ($row=mysqli_fetch_assoc($res)) {
$t1=$row['Mail'];
$t2=$row['Password'];
$fn=$row['First'];
$ln=$row['Last'];
if ($tm==$t1 && $to==$t2) {
include("Database/db_kits.php");
$sq='TRUNCATE TABLE kits;';
mysqli_query($conn,$sq);
header("Location: home.php");
session_start();
$_SESSION["user"]=$t1;
$_SESSION['fn']=$fn;
$_SESSION['ln']=$ln;
}
}
}
mysqli_close($conn);
?>