php_pracownia-programowania/add.php

15 lines
383 B
PHP
Raw Normal View History

2018-12-30 01:24:27 +01:00
<?php
session_start();
2018-12-30 01:29:08 +01:00
include 'sql/db_login.php';
2018-12-30 01:24:27 +01:00
$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');
?>