-
Notifications
You must be signed in to change notification settings - Fork 1
/
update.php
133 lines (91 loc) · 2.67 KB
/
update.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
<!DOCTYPE html>
<html >
<head>
<meta charset="UTF-8">
<title>Delete Data</title>
<link rel="stylesheet" type="text/css" href="css/style1.css">
<style>
.form{
width: 500px;
height: 200px;
text-align: center;
margin: 0 auto;
background-color: rgba(236, 240, 241, 0.78);
border-radius: 4px;
margin: 0 auto;
margin-top: 120px;
}
.form img{
width: 120px;
height: 120px;
margin-top: -60px;
margin-bottom: 2px;
}
#imd{
color: brown;
font-size: x-large;
margin-top: 10px;
}
header, footer {
background: #ccd9ff;
height: 20vh;
}
header, footer, article, nav, aside {
padding: 1em;
}
</style>
</head>
<body>
<div style="display:flex; justify-content: space-between;">
<div>
<img src="images/IMDD.png" width="355" height="75" align="left">
</div>
<div>
<a href="http://localhost/login-system/profile.php"><img src="images/IMD_LOGO.png" width="80" height="75" align="centre"> </a>
</div>
<div style="margin-right: 10px;">
<p id="imd"><strong> IP Search</strong><br>
Indian Meteorogical Department
</p>
</div>
</div>
<div style="background-color: brown;padding: 6px;margin-top: -10px;"></div>
<div class="form">
<h1>UPDATE DATA</h1>
<form action="update.php" method="post">
<div class="field-wrap">
<input type="text"required name="priv" autocomplete="off" placeholder="Enter Private Ip*" />
</div>
<button class="button button-block"/>Update</button>
<?php
/* Password reset process, updates database with new user password */
require 'db.php';
session_start();
// Make sure the form is being submitted with method="post"
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$priv1=$_POST['priv'];
$flag=0;
$flag1=0;
$conn = new mysqli("localhost","root","","imd");
$sql3="SELECT * FROM ip WHERE private_ip = '$priv1'";
$record3= mysqli_query($conn,$sql3);
$e1=mysqli_fetch_assoc($record3);
$user_id1 = $e1['user_id'];
$_SESSION['user_id']= $user_id1;
if ($_SESSION['user_id']!=0) {
header("location: update1.php");
}
else
{
echo "<script>
alert('No such Ip Found ');
window.location.href='update.php';
</script>";
}
}
?>
</form>
<!-- <a href='profile.php'><button class=' button button-block' name=''back/>Back</button></a> -->
</div>
</body>
</html>