-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaccount_retrieve.php
More file actions
44 lines (35 loc) · 999 Bytes
/
Copy pathaccount_retrieve.php
File metadata and controls
44 lines (35 loc) · 999 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
// Database credentials
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "database_name";
// Create a connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
// Prepare a statement
$stmt = $conn->prepare("SELECT * FROM users WHERE username = ?");
// Bind parameters
$stmt->bind_param("s", $username);
// Set parameters
$username = "john_doe";
// Execute the statement
$stmt->execute();
// Get the result set
$result = $stmt->get_result();
// Process the result set
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
// Do something with the row data
}
}
?>
<!-- HTML code for the account login form -->
<form action="forgot_password.php" method="post">
<label for="email">Email:</label>
<input type="email" id="email" name="email" required>
<button type="submit">Reset Password</button>
</form>