-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdummy.php
More file actions
72 lines (59 loc) · 1.43 KB
/
dummy.php
File metadata and controls
72 lines (59 loc) · 1.43 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
session_start();
include('connect.php');
?>
<?php
// Query the data from the table
$query = "SELECT S_ID, Name, Mail FROM student WHERE 1";
$result = mysqli_query($conn, $query);
// Process the form submission
if (isset($_POST['selected_id'])) {
$selectedID = $_POST['selected_id'];
$_SESSION['testID'] = $selectedID;
header('Location: test.php');
exit();
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Grid Example</title>
<style>
table {
border-collapse: collapse;
}
th,
td {
padding: 5px;
border: 1px solid #ccc;
}
</style>
</head>
<body>
<table>
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>Mail</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php while ($row = mysqli_fetch_assoc($result)) { ?>
<tr>
<td><?php echo $row['S_ID']; ?></td>
<td><?php echo $row['Name']; ?></td>
<td><?php echo $row['Mail']; ?></td>
<td>
<form method="post" action="dummy.php">
<input type="hidden" name="selected_id" value="<?php echo $row['S_ID']; ?>">
<button type="submit">Process</button>
</form>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</body>
</html>