From 85eb827840c0b2840872bce9f0eb769bb133a2ac Mon Sep 17 00:00:00 2001 From: Krystian Rzepa Date: Fri, 28 Dec 2018 19:12:00 +0000 Subject: [PATCH] Zaktualizuj 'index.php' --- index.php | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/index.php b/index.php index 2c66658..f1e18a2 100644 --- a/index.php +++ b/index.php @@ -2,13 +2,33 @@ session_start(); $db_servername = 'localhost'; + $db_login = ''; $db_password = ''; $db_name = ''; +$db_login_tasks = ''; +$db_password_tasks = ''; +$db_name_tasks = ''; + mysql_connect("$db_servername", "$db_login", "$db_password"); mysql_select_db("$db_name"); +$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'` (tasks) VALUES ('$task')"); + header('location: index.php'); +} + +?> + + + +".$_SESSION['login'].""; echo ' [Wyloguj]'; + + ?> + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + +
NumerZadanieAkcja
+ USUN +
+ +