-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathforget_password.php
73 lines (59 loc) · 1.82 KB
/
forget_password.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
<?php
session_start();
require 'dbconfig/config.php';
?>
<!DOCTYPE html>
<html>
<head>
<title>SignUp</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body style="background-color:#7f8c8d">
<div id = "main-wrapper">
<center>
<h2>Request for new password</h2>
<img src = "Images/download.png" width="100px"/>
</center>
<form class="myform" action="" method="post">
<label><b>Enter your Contact Number</b></label>
<input name="contactno" type="text" pattern="^\d{10}$" class="inputvalues" placeholder="Type your contact number (ex: 0712345678)" title= "enter your contact number using only 10 numbers" required/><br>
<input name="lost_password" type="submit" id="signin_btn" value="Requesting new password"/><br>
<a href = "index.php"><input type="button" id="back_btn" value="Back"/></a>
</form>
<?php
if(isset($_POST['lost_password']))
{
$contactno = $_POST['contactno'];
$new ="";
$query = "SELECT * FROM login WHERE contactNo = '$contactno'";
$query_run = mysqli_query($con,$query);
$contactno1=substr($contactno,1,9);
$contactno2='+94'.$contactno1;
$_SESSION['contactno']= $contactno;
if ($query_run){
while($row=mysqli_fetch_row($query_run))
{
require 'int-send_sms.php';
$username = 'KushalNaresh';
$password = 'kush@123';
$msisdn = $contactno2;
$url = 'https://bulksms.vsms.net/eapi/submission/send_sms/2/2.0';
$unicode_msg = $row[9];
$post_body = unicode_sms( $username, $password, $unicode_msg, $msisdn );
$result = send_message( $post_body, $url );
//$new = $row[6];
}
}
if(mysqli_num_rows($query_run)>0)
{
header("location: reset_password.php");
}
else
{
echo '<script type = "text/javascript">alert("Invalid Credentials.")</script>';
}
}
?>
</div>
</body>
</html>