-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUserdescription.php
More file actions
72 lines (70 loc) · 1.93 KB
/
Userdescription.php
File metadata and controls
72 lines (70 loc) · 1.93 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
<?php
include('config.php')
?>
<?php
if(isset($_GET['submit'])){
$username = $_GET['name'];
$sql = "SELECT * FROM `users` WHERE `username`='$username'";
$result = mysqli_query($conn, $sql);
if($result->num_rows > 0){
?>
<table>
<tr>
<th>Name</th>
<th>Eamil</th>
<th>gender</th>
<th>city</th>
<th>update</th>
<th>delete</th>
</tr>
<?php
// while($result->fetch_array()){
while($row = $result->fetch_assoc()){
?>
<tr>
<th><?php echo $row['username'] ?></th>
<th><?php echo $row['email'] ?></th>
<th><?php echo $row['gender'] ?></th>
<th><?php echo $row['city'] ?></th>
<th><a href="edit.php?id=<?php echo $row['id'] ?>">
<input type="button" name="" value="edit"></a></th>
<th><a href="delete.php?id=<?php echo $row['id'] ?>"><input type="button" name="" value="delete"></a></th>
</tr>
<?php
}
?>
</table>
<?php
}
else{
echo "No user with this name";
}
}
else{
echo "Enter Name";
}
?>
<!DOCTYPE html>
<title>user details</title>
<style type="text/css">
table,td,th,tr{
width: 60%;
text-align: center;
border: 2px solid black;
border-collapse: collapse;
border-spacing: 5px;
padding: 10px;
font-family: sans-serif;
}
tr:nth-child(even){
background-color: #dddddd;
}
</style>
<html>
<body>
<form method="GET" action="pDetails.php">
Name <input type="text" name="name" required ><br>
<input type="submit" name="submit" value="Click Here To Submit Your Data">
</form>
</body>
</html>