-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAddStaffForm.php
More file actions
34 lines (31 loc) · 973 Bytes
/
AddStaffForm.php
File metadata and controls
34 lines (31 loc) · 973 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
<html>
<head>
<meta http-equiv="refresh" content="0; url=Staff.php" />
</head>
<body>
<?php
include "db.php";
// get content from form
$firstname = $_POST["firstname"];
$surname = $_POST["surname"];
$position = $_POST["position"];
$salary = $_POST["salary"];
$address = $_POST["address"];
$city = $_POST["city"];
$postcode = $_POST["postcode"];
$email = $_POST["email"];
$phonenumber = $_POST["phonenumber"];
$branch = $_POST["branch"];
$password = $_POST["password"];
$privileges = $_POST["privileges"];
// SQL Insert using variable names
if($salary==null)
{
$salary = 0;
}
mysql_query("INSERT INTO staff(staffID, sFname, sSurname, position, salary, sAddress, sCity, sPostcode, sEmail, sPhoneNumber, branchID, password, privileges)
VALUES (staffID, '$firstname', '$surname', '$position', '$salary', '$address', '$city', '$postcode', '$email', '$phonenumber', '$branch', '$password', '$privileges')", $db);
echo "New staff member added <br>";
?>
</body>
</html>