-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmailuserid.php
More file actions
43 lines (38 loc) · 954 Bytes
/
mailuserid.php
File metadata and controls
43 lines (38 loc) · 954 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
<?php
$servername="127.0.0.1";
$username="root";
$password="";
$dbname="passwordmanager";
$connect = new mysqli("$servername",$username,$password,$dbname);
if(isset($_POST['submit']))
{
$email = $_POST['email'];
$check_db = "SELECT * FROM pass_login WHERE email='$email'";
$result = mysqli_query($connect,$check_db);
$rowcount=mysqli_num_rows($result);
if($rowcount==0)
{
echo "<script>
alert('There is no such user. Redirecting you to the sign up page.');
window.location.href='register.php';
</script>";
}
else
{
$tp = $connect->query($check_db);
while($row = $tp->fetch_assoc())
{
$uid = $row['username'];
}
$sub = "User ID for SafeKeep Account.";
$body = "Your User ID for your SafeKeep Account is : $uid";
mail($email,$sub,$body);
echo "
<script>
alert('Check your mail for your User ID.');
window.location.href='index.php';
</script>
";
}
}
?>