-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaddInformation.php
21 lines (21 loc) · 981 Bytes
/
addInformation.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
$informationName = $_POST['informationName'];
$informationMinDescription = $_POST['informationMinDescription'];
$informationArray = $_POST['informationArray'];
$informationDescription = $_POST['informationDescription'];
require 'mysql.php';
mysqli_select_db($conn, $dbName);
if(empty($informationName) || empty($informationMinDescription) || empty($informationArray) || empty($informationDescription)){
$conn->close();
header("Location:adminPanel.php?message=inputErrorAddInformation");
} else {
$sql_insert_admin = "INSERT INTO $tabelInformationName (informationName, informationMinDescription, informationArray, informationDescription) VALUES ('$informationName', '$informationMinDescription', '$informationArray', '$informationDescription')";
if ($conn->query($sql_insert_admin) === TRUE) {
$conn->close();
header("Location:adminPanel.php");
} else {
echo("Error adding component: ".$conn->error);
}
$conn->close();
}
?>