-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinsertcontain.php
More file actions
39 lines (36 loc) · 1007 Bytes
/
Copy pathinsertcontain.php
File metadata and controls
39 lines (36 loc) · 1007 Bytes
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
<!DOCTYPE html>
<html>
<link rel= "stylesheet" href= "style.css">
<div align = center>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>insert a realtionship</title>
</head>
<body>
</body>
</html>
<?php
include "config.php";
?>
<form action="insertcontain.php" method="POST">
<input type="text" name="pname" placeholder="The name of the prison">
<br>
<input type="text" name="cell_no" placeholder="The cell number">
<br>
<input type="text" name="number_of" placeholder="The number of the cells">
<br>
<button>INSERT</button>
</form>
</div>
<?php
if(isset($_POST['pname']) AND isset($_POST['cell_no']))
{
$pname = $_POST['pname'];
$cell_no = $_POST['cell_no'];
$number_of = $_POST['number_of'];
$sql_statement = "INSERT INTO contain(pname, cell_no, number_of) VALUES ('$pname', '$cell_no', '$number_of')";
$result = mysqli_query($db, $sql_statement);
header ("Location: indexcontain.php");
}
?>