Dodaj 'add.php'
This commit is contained in:
parent
fcbd8b6f92
commit
071e0c885f
18
add.php
Normal file
18
add.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
$db_servername = 'localhost';
|
||||
$db_login_tasks = '';
|
||||
$db_password_tasks = '';
|
||||
$db_name_tasks = '';
|
||||
|
||||
$db = mysqli_connect("$db_servername", "$db_login_tasks", "$db_password_tasks", "$db_name_tasks");
|
||||
|
||||
if (isset($_POST["submit"]) && $_SESSION['zalogowany'] = true) {
|
||||
$task = $_POST["task"];
|
||||
$login = $_SESSION['login'];
|
||||
mysqli_query($db, "INSERT INTO `tasks_$login` (task) VALUES ('$task')");
|
||||
}
|
||||
header('Location: index.php');
|
||||
|
||||
?>
|
Loading…
Reference in New Issue
Block a user