-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify_script.php
More file actions
69 lines (42 loc) · 1.21 KB
/
verify_script.php
File metadata and controls
69 lines (42 loc) · 1.21 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
<?php
if(isset($_POST['submit']))
{
require 'common.php';
session_start();
$email=$_POST['email'];
$queryv = "SELECT verified FROM users WHERE email='$email' ";
$runq = mysqli_query($con,$queryv);
$rowsc=mysqli_fetch_array($runq);
$ver=$rowsc['verified'];
if($ver==0){
$_SESSION['email']=$email;
$key = time();
$vkeyin="UPDATE users SET vkey='$key' WHERE email='$email'";
$runqu = mysqli_query($con,$vkeyin);
$extractk="SELECT vkey FROM users WHERE email='$email'";
$runextract=mysqli_query($con,$extractk);
$fetching=mysqli_fetch_array($runextract);
$vkey=$fetching['vkey'];
echo "do not refresh this page<br><br>";
$to= $email;
$subject='verification mail:somebody is trying to access your gymkhana printing account';
$message='Is that you ..?enter this key to get your account verified.'.$vkey;
$headers='From :divyanshmaduriya02@gmail.com';
if(mail($to , $subject , $message, $headers))
{
echo "sent<br><br>check your inbox<br><br> ";
echo"<form method='post' action='code.php'>";
echo" <input type='text' placeholder='activation code' name='code'>";
echo"<input type='submit' value='done' name='done' >";
echo "</form>";
}
else
{
echo "email failed";
}
}
else{
echo"already a verified account";
}
}
?>