-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinsertprotected_by.php
More file actions
36 lines (33 loc) · 861 Bytes
/
Copy pathinsertprotected_by.php
File metadata and controls
36 lines (33 loc) · 861 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
<!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="insertprotected_by.php" method="POST">
<input type="text" name="pname" placeholder="The name of the prison">
<br>
<input type="text" name="gid" placeholder="The id of the guardian">
<br>
<button>INSERT</button>
</form>
</div>
<?php
if(isset($_POST['pname']) AND isset($_POST['gid']))
{
$pname = $_POST['pname'];
$gid = $_POST['gid'];
$sql_statement = "INSERT INTO protected_by(pname, gid) VALUES ('$pname', '$gid')";
$result = mysqli_query($db, $sql_statement);
header ("Location: indexprotected_by.php");
}
?>