-
Notifications
You must be signed in to change notification settings - Fork 4
/
Get_forgt2.php
156 lines (135 loc) · 4.08 KB
/
Get_forgt2.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
<?php
session_start();
include "db/db.php";
if (isset($_POST["email"])) {
$email = $_POST['email'];
$password = $_POST['password'];
$repassword = $_POST['repassword'];
$mobile = $_POST['mobile'];
$cnic= $_POST['cnic'];
$emailValidation = "/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-z0-9]+(\.[a-z]{2,4})$/";
$number = "/^[0-9]+$/";
$cnic_v = "/[0-9]{5}(-[0-9]{7})(-[0-9]{1})$/";
if( empty($email) || empty($password) || empty($repassword) ||
empty($mobile) || empty($cnic)){
echo "
<div class='alert alert-danger'>
<a href='#' class='close' data-dismiss='alert' aria-label='close'>×</a><b>PLease Fill all fields..!</b>
</div>
";
exit();
} else {
if(!preg_match($emailValidation,$email)){
echo "
<div class='alert alert-danger'>
<a href='#' class='close' data-dismiss='alert' aria-label='close'>×</a>
<b>this $email is not valid Email Address </b>
</div>
";
exit();
}
if(strlen($password) < 9 ){
echo "
<div class='alert alert-danger'>
<a href='#' class='close' data-dismiss='alert' aria-label='close'>×</a>
<b>Password is weak</b>
</div>
";
exit();
}
if(strlen($repassword) < 9 ){
echo "
<div class='alert alert-danger'>
<a href='#' class='close' data-dismiss='alert' aria-label='close'>×</a>
<b>Password is weak</b>
</div>
";
exit();
}
if($password != $repassword){
echo "
<div class='alert alert-danger'>
<a href='#' class='close' data-dismiss='alert' aria-label='close'>×</a>
<b>password is not same</b>
</div>
";
exit();
}
if(!preg_match($number,$mobile)){
echo "
<div class='alert alert-danger'>
<a href='#' class='close' data-dismiss='alert' aria-label='close'>×</a>
<b>Mobile number $mobile is not valid</b>
</div>
";
exit();
}
if(!(strlen($mobile) == 11)){
echo "
<div class='alert alert-danger'>
<a href='#' class='close' data-dismiss='alert' aria-label='close'>×</a>
<b>Mobile number must be 11 digit</b><i><strong>For Example : 03XXXXXXXXX </strong></i>
</div>
";
exit();
}
if(!preg_match($cnic_v,$cnic)){
echo "
<div class='alert alert-danger'>
<a href='#' class='close' data-dismiss='alert' aria-label='close'>×</a>
<b>CNIC Number $cnic is not valid</b><small> Fellow its For Example : xxxxx-xxxxxxx-x </small>
</div>
";
exit();
}
if(!(strlen($cnic) == 15)){
echo "
<div class='alert alert-danger'>
<a href='#' class='close' data-dismiss='alert' aria-label='close'>×</a>
<b>CNIC Number must be 13 digit and TWO - Add </b><i><strong> Fellow its For Example : xxxxx-xxxxxxx-x </strong></i>
</div>
";
exit();
}
$sqlcnic = "SELECT * FROM user_info WHERE cnic = '$cnic' and email='$email' and mobile='$mobile' LIMIT 1" ;
$check_querycnic = mysqli_query($con,$sqlcnic);
$count_cnic = mysqli_num_rows($check_querycnic);
if($count_cnic > 0)
{
$passwordm = md5($password);
$sqlAB = "UPDATE `user_info` SET `password`='$passwordm'";
$run_query = mysqli_query($con,$sqlAB);
if(!empty($run_query)){
echo "
<div class='alert alert-success'>
<a href='#' class='close' data-dismiss='alert' aria-label='close'>×</a>
<b> Your Successfully Password Update </b>
</b><small><b>
<i><a href='Customer_login.php'><blink> Login Click Here </blink></a></i>
</b></small>
</div>
";
exit();
}
else{
echo "
<div class='alert alert-danger'>
<a href='#' class='close' data-dismiss='alert' aria-label='close'>×</a>
<b> Not Update Password Account Please Connect to Admin</b>
</div> ";
exit();
}
}
else
{
echo "
<div class='alert alert-danger'>
<a href='#' class='close' data-dismiss='alert' aria-label='close'>×</a>
<b>Information is Wrong</b>
</div>
";
exit();
}
}
}
?>