-
Notifications
You must be signed in to change notification settings - Fork 0
/
Update-data.php
70 lines (38 loc) · 2.16 KB
/
Update-data.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
<?php
include_once 'connect.php';
if(count($_POST)>0)
{
//query to update the data
mysqli_query($conn,"UPDATE registerr set id='" . $_POST['id'] . "', Firstname='" . $_POST['Firstname'] . "', Lastname='" . $_POST['Secondname'] . "', email='" . $_POST['Email'] . "' ,Password='" . $_POST['Password'] . "', ConfirmPassword='" . $_POST['Confim'] . " ' WHERE id='" . $_POST['id'] . "'");
$message = "Record Modified Successfully";
}
$result = mysqli_query($conn,"SELECT * FROM registerr WHERE id='" . $_GET['id'] . "'"); //data will be gotten from selected id and displayed
$row= mysqli_fetch_array($result);//data is fetched
?>
<html>
<head>
<title>UberEats-Register Page</title>
<link rel="stylesheet" href="Register.css">
</head>
<body>
<div class="form-area">
<h4>Registration</h4>
<h6>Please fill in the details to create an account with us.</h6>
<form action="update.php" method="post">
<div> <?php if(isset($message)) { echo $message; } ?> </div>
<p>Name</p><br>
<input type='text' name="Firstname" value="<?php echo $row['Firstname'];?>" placeholder='First Name' required>
<input type='text'name="Secondname" value="<?php echo $row['Secondname'];?>"placeholder='Last Name ' required>
<p>Email</p><br>
<input type='text'name="Email" value="<?php echo $row['Email'];?>"placeholder='Email Id' required>
<p> Password</p><br>
<input type='text'name="Password" value="<?php echo $row['Password'];?>"placeholder='Enter Password' required>
<p> Confirm Password</p><br>
<input type='text'name="ConfirmPassword" value="<?php echo $row['Confirm'];?> "placeholder='Confirm Password' required>
<input type="hidden" id="nID" name="id" value="<?= $row['id']?>">
<p>By creating an account you agree to our <a href="#">Terms & Privacy</a>.</p><br>
<button type='submit' name="submit" value="submit" class='update-btn'><strong>Update</strong></button>
</form>
</div>
</body>
</html>