-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontrol.php
More file actions
115 lines (96 loc) · 3.23 KB
/
Copy pathcontrol.php
File metadata and controls
115 lines (96 loc) · 3.23 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
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
<?php
session_start();
require_once 'token.php';
$display_messsge = "";
if(isset($_POST['fname'], $_POST['lname'], $_POST['csrf_token'])){
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$csrf_token = $_POST['csrf_token'];
if(!empty($fname) && !empty($lname) && !empty($csrf_token))
{
if(Token::check_token($csrf_token))
{
$messsge = "Updated Successfully! " ;
$display_messsge = "<p class=\"text-success\"><strong>".$messsge."</strong></p>";
}
else{
$messsge = "Invalid token can not updated!!!!";
$display_messsge= "<p class=\"text-danger\"><strong>".$messsge."</strong></p>";
}
}
else{
echo "<script>alert('Check your details');</script>";
}
}
?>
<html>
<head>
<meta charset="UTF-8">
<title>Update user</title>
<link rel="stylesheet" href="style.css">
<meta charset="UTF-8">
<link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="path/to/font-awesome/css/font-awesome.min.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="css/testlogin.css" rel="stylesheet">
<link rel="stylesheet" href="https://jqueryvalidation.org/files/demo/site-demos.css">
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/jquery.validation/1.15.0/jquery.validate.min.js"></script>
<script src="https://cdn.jsdelivr.net/jquery.validation/1.15.0/additional-methods.min.js"></script>
</head>
<body>
<div class="container-fluid">
<div class="second">
<div class="inside">
<?php
if (session_id() == '' || !isset($_SESSION['logeduser'])) {
header('Location: ./index.php');
?>
<?php
}
else {
echo "Hi, " . $_SESSION['logeduser'] . " | ";
?>
<form action="" method ="post">
<table class="table1">
<tr>
<td><h2> <td><h2 class="title-up"> Update
User</h2></td></h2></td>
</tr>
<tr>
<td><label for="fname">First Name</label></td>
<td>
<input class="updatename left" name="fname" placeholder=" First Name" value="" type="text" required>
</td>
</tr>
<tr>
<td><label for="lname">Last Name </label></td>
<td><input class="updatepass" name="lname" placeholder=" Last Name" value="" type="text" required></td>
</tr>
<tr>
</tr>
</table>
<div>
<input id="login-username" type="hidden" class="form-control" name="csrf_token" value="<?php echo $_SESSION["token"]; ?>">
</div>
<button class="login" value="Update"> Update </button>
<button type="reset" value="Reset" class="cancel">Reset</button>
<a href="logout.php" class="cancel btn btn-default" style="float: right;
margin-top: 8px;
background-color: rosybrown;">Logout</a>
</form>
<div>
<?php
echo $display_messsge;
}
?>
</div>
<script type="text/javascript" src="./script.js"></script>
</div>
</div>
</div>
</body>
</html>