To-Do List Application Overview A PHP-based to-do list web app with MySQL and Bootstrap 5.3.8. Supports user registration, login, and task management (create, edit, complete, delete) with multilingual support (e.g., Russian: 'Завершено', 'В ожидании'). Tasks are shared across all authenticated users (no user_id column). Features
Authentication: User registration and login required. Task Management: Create/edit tasks with title and description, mark as completed, delete with confirmation. Multilingual: Supports English, Russian, Spanish, etc., with language switcher. Security: PDO prepared statements, htmlspecialchars() for XSS prevention, password hashing. Responsive: Bootstrap UI.
Tech Stack
Backend: PHP 7.4+, MySQL Frontend: Bootstrap 5.3.8 Environment: XAMPP (Apache, MySQL)
Setup
Install XAMPP: Download from apachefriends.org, start Apache and MySQL. Deploy Files: Place in C:\xampp\htdocs\to_do_list:
index.php, add_task.php, edit_task.php, complete_task.php, delete_task.php, registration.php, authenticate.php, config.php, lang/ru.php
Database:
In phpMyAdmin (http://localhost/phpmyadmin), create to_do_list database. Run: sqlCREATE TABLE users ( id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY, username VARCHAR(255) NOT NULL UNIQUE, email VARCHAR(255) NOT NULL UNIQUE, password VARCHAR(255) NOT NULL ); CREATE TABLE tasks ( id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY, title VARCHAR(255) NOT NULL, description TEXT, status ENUM('pending', 'completed') DEFAULT 'pending', created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP );
Update config.php: phpsetAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch (PDOException $e) { die("Connection failed: " . $e->getMessage()); } ?>
Translations: Ensure lang/ru.php: php 'Список дел', 'task_name' => 'Название задачи', 'description' => 'Описание', 'status' => 'Статус', 'created_at' => 'Создано', 'actions' => 'Действия', 'add_task' => 'Добавить задачу', 'complete_task' => 'Завершить задачу', 'edit_task' => 'Редактировать задачу', 'delete_task' => 'Удалить задачу', 'save' => 'Сохранить', 'cancel' => 'Отмена', 'pending' => 'В ожидании', 'completed' => 'Завершено', 'confirm_delete' => 'Вы уверены, что хотите удалить эту задачу?', 'title_registration' => 'Регистрация', 'username' => 'Имя пользователя', 'email' => 'Электронная почта', 'password' => 'Пароль', 'register' => 'Зарегистрироваться', 'log_in' => 'Войти', 'all_fields_required' => 'Все поля обязательны.', 'only_letters_numbers_underscores' => 'Только буквы, цифры и подчеркивания.', 'invalid_email' => 'Неверный формат email.', 'password_length' => 'Пароль должен быть не короче 8 символов.', 'username_taken' => 'Имя пользователя или email уже заняты.', 'registration_failed' => 'Ошибка регистрации. Попробуйте снова.' ]; ?>
Usage
Register: http://localhost/to_do_list/registration.php?lang=ru Login: http://localhost/to_do_list/authenticate.php?lang=ru Manage Tasks: http://localhost/to_do_list/index.php?lang=ru
Add/edit tasks with title and description. Complete or delete tasks. Switch languages via dropdown.
Notes
Limitation: Tasks are shared (no user_id). For user-specific tasks:
sqlALTER TABLE tasks ADD user_id BIGINT UNSIGNED;
UPDATE tasks SET user_id = 1; -- Use valid user ID
ALTER TABLE tasks MODIFY user_id BIGINT UNSIGNED NOT NULL;
ALTER TABLE tasks ADD FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
Update scripts to filter by user_id.
Extensibility: Add languages via lang/.php.
Security: Uses PDO and password hashing.
Troubleshooting
DB Issues: Check config.php and table structure.
Translations: Verify lang/ru.php keys.
Access: Ensure authenticate.php session handling.
Instructions
Save: Copy this into README.md in C:\xampp\htdocs\to_do_list.
Verify: Ensure all files are in place and test at http://localhost/to_do_list/index.php?lang=ru with Russian translations.
Next Steps: If you want to add user_id for user-specific tasks, I can provide updated scripts and SQL instructions.