-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfogot.php
182 lines (140 loc) · 5.04 KB
/
fogot.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<!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>Account | K-Tech</title>
<link rel="icon" href="images/icon.png">
<link rel="stylesheet" href="Style.css">
</head>
<body>
<!--Header-->
<div class="container">
<?php include('partials-front/navbar.php')?>
<?php include('partials-front/serachbar.php')?>
<?php
if(isset($_SESSION['id']))
{
header('location:index.php');
}
?>
</div>
<!-- Account details -->
<div class="account-page">
<div class="container">
<?php
if(isset($_SESSION['reg']))
{
echo $_SESSION['reg'];
unset($_SESSION['reg']);
}
if(isset($_SESSION['wrong']))
{
echo $_SESSION['wrong'];
unset($_SESSION['wrong']);
}
?>
<div class="row">
<div class="col-2">
<!-- Slideshow container -->
<div class="slideshow-container">
<!-- Full-width images with number and caption text -->
<div class="mySlides fade">
<img src="images/1.png" style="width:100%">
</div>
<div class="mySlides fade">
<img src="images/4.png" style="width:100%">
</div>
</div>
</div>
<div class="col-2">
<div class="form-container">
<div class="form-btn">
<span >Recover Passward</span>
</div>
<form action="" id="" method="POST">
<input type="text" name="txtUsername" placeholder="User Name" required>
<input type="email" name="txtEmail" placeholder="Email" required>
<input type="password" name="txtPassword" placeholder="New Passward" required>
<button type="submit" name="reg" class="btn">Recover</button>
</form>
<?php
if(isset($_POST['reg']))
{
$name = $_POST['txtUsername'];
$email = $_POST['txtEmail'];
$password = md5($_POST['txtPassword']);
$sql2 = "SELECT email FROM user WHERE email = '$email' ";
$res2 = mysqli_query($conn,$sql2);
$count2 = mysqli_num_rows($res2);
if($count2==1)
{
$sql = "UPDATE user SET password ='$password' WHERE email LIKE '$email' AND username LIKE '$name'";
$res = mysqli_query($conn,$sql);
if($res)
{
$_SESSION['reg']="<div class='text-center sucsses'>Recovery Succusfull<br>Login Now!</div>";
header('location:Account.php');
}
}
else
{
$_SESSION['reg']="<div class='text-center error'>Wrong User Name or Email<br>Try Again!</div>";
}
}
?>
</div>
</div>
</div>
</div>
</div>
<!----------Footer--------->
<?php include('partials-front/footer.php')?>
<!--js for menu toggle-->
<script>
var MenuItem = document.getElementById("MenuItem");
MenuItem.style.maxHeight="0px";
function menutoggle(){
if(MenuItem.style.maxHeight=="0px"){
MenuItem.style.maxHeight="200px";
}
else{
MenuItem.style.maxHeight="0px";
}
}
</script>
<!--Js for slideshow-->
<script>
let slideIndex = 0;
showSlides();
function showSlides() {
let i;
let slides = document.getElementsByClassName("mySlides");
for (i = 0; i < slides.length; i++) {
slides[i].style.display = "none";
}
slideIndex++;
if (slideIndex > slides.length) {slideIndex = 1}
slides[slideIndex-1].style.display = "block";
setTimeout(showSlides, 5000); // Change image every 2 seconds
}
</script>
<!-- Toggle form -->
<script>
var Login=document.getElementById("login");
var Register=document.getElementById("register");
var Indicator =document.getElementById("Indicator")
function login(){
Register.style.transform="translateX(0px)";
Login.style.transform="translateX(0px)";
Indicator.style.transform="translateX(100px)";
}
function register(){
Register.style.transform="translateX(300px)"
Login.style.transform="translateX(300px)"
Indicator.style.transform="translateX(0px)";
}
</script>
</body>
</html>