-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaddpos.php
More file actions
38 lines (30 loc) · 1.01 KB
/
Copy pathaddpos.php
File metadata and controls
38 lines (30 loc) · 1.01 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
<?php
session_start();
include "connection.php";
if(isset($_POST['addpos']))
{
$position = $_POST['pos'];
$check_q = mysqli_query($conn, "select *from `position` where position='$position'");
$check = mysqli_num_rows($check_q);
if($check>0)
{
$_SESSION['positionExist'] = "The `$position` already exist in the list!";
header("Location: x-people.php#pos");
}
else
{
//SAVED ITEM NAME
$insert = mysqli_query($conn, "insert into `position` (position) values ('$position')");
if($insert)
{
$_SESSION['posadded'] = "You have successfully created `$position` position! ";
header("Location: x-people.php#pos");
}
else
{
//errorecho '<script type="text/javascript"> alert("Error Uploading Data!"); </script>';
header("Location: x-people.php#pos");
}
}
}
?>