========================== DriveAds Dashboard Setup & Usage Guide (Complete) ========================== Hi! This file will teach you how to set up and use your DriveAds Dashboard, step by step. It’s super easy and explained in a simple way, like telling a story to a 7-year-old. --- 1. What is this all about? You have a website where people visit and submit a form. You want to: - Keep track of who visits (real people and bots) - Track how many people submit your form - Have a dashboard where you can see all these stats - Have a login system so only you or your team can see the dashboard - Let users change their display name and password - Let users upload a profile picture (avatar) - Make everything look nice and professional --- 2. Setting Up Your Database (where all data lives) You need a MySQL database. Use a tool like phpMyAdmin or your hosting control panel and run these commands to create tables: ```sql CREATE TABLE visitor_stats ( id INT AUTO_INCREMENT PRIMARY KEY, ip VARCHAR(45) NOT NULL, user_agent TEXT, is_bot TINYINT(1) DEFAULT 0, visited_at DATETIME DEFAULT CURRENT_TIMESTAMP, form_submitted TINYINT(1) DEFAULT 0 ); CREATE TABLE users ( id INT AUTO_INCREMENT PRIMARY KEY, username VARCHAR(50) UNIQUE NOT NULL, password_hash VARCHAR(255) NOT NULL, display_name VARCHAR(100) NOT NULL, avatar_path VARCHAR(255) DEFAULT NULL ); visitor_stats tracks each visit and whether the visitor submitted the form. users stores the login users’ info with hashed passwords and avatar. Connecting Your Website to the Database Create a file named db_config.php: php Copy Edit This file is included in other scripts to connect to your database. Creating Your First Admin User Use this PHP code to generate a secure password hash: php Copy Edit Copy the output (it looks like random letters and numbers). Insert a new user into the users table with this SQL (replace with your generated hash): sql Copy Edit INSERT INTO users (username, password_hash, display_name) VALUES ('admin', '', 'Admin'); Upload Your Website Files Upload these files to your web hosting: index.php — homepage and form page, records visits submit.php — processes the form submission and sends data to Telegram login.php — login page for the dashboard dashboard.php — main dashboard showing stats profile.php — profile page where users update their name, password, and avatar db_config.php — database connection config file avatars/ folder — where profile pictures are saved (make sure it’s writable) How It Works: The Flow When someone visits your site (index.php), their IP, user agent, and bot status are recorded. When they submit a form (submit.php), the submission is recorded too. You log in through login.php to see dashboard.php with all stats. You can update your profile (display name, password, avatar) in profile.php. The display name changes everywhere, including the footer on dashboard and login pages. Avatar uploads show your picture next to your name and footer. Important Code Notes and Features Passwords are stored safely using PHP’s password_hash and password_verify. Bots are detected based on common bot keywords in the user agent. The system counts total visits, bots, real users, and form submissions. Profile avatar uploads are checked for allowed image types and size. Changing display name updates it in the users table, reflected everywhere. The dashboard and login pages have professional, clean Bootstrap-based design. The footer dynamically shows the logged-in user’s display name and avatar. Permissions & Troubleshooting Make sure your avatars/ folder has the right permissions (like 755 or 775) so PHP can save pictures. If login or stats don’t work, double-check your database info and tables. Clear your browser cache if you see outdated info. Use strong passwords for your admin account. Backup your database regularly. Security Tips Never share your admin login with strangers. Keep your hosting and PHP version up to date. Use HTTPS on your site for encryption. Regularly update your password. Limit file upload size in PHP if needed. What to Do Next? Test logging in using the admin user you created. Visit the dashboard to see visitor stats update as people visit. Try submitting the form to see submission stats. Edit your profile to change your display name and upload an avatar. Log out and log back in to test everything works smoothly. Thank you for using the DriveAds Dashboard! 🚀 If you want to improve or add features, you can always ask for help or search for tutorials online. Full conversation & explanations that helped create this: [Conversation summary:] We designed a database to track visitors and form submissions. We created secure login system with hashed passwords. We built a dashboard with professional Bootstrap UI showing stats. We added profile management: display name, password change, avatar upload. Explained how to connect, upload files, permissions, and usage. Provided security advice for safe management. If you want the actual PHP codes or more help, just ask! End of README. yaml Copy Edit --- If you want, I can also prepare the actual `.txt` file ready to download. Would you like me to do that?