Skip to content

πŸ“˜ Wiki | How to setup

push42 edited this page Jul 31, 2023 · 1 revision

πŸ“Š Database Configuration & Setup

Step 1: Open the PHP files in your code editor of choice.

Step 2: Look for the following code snippets in the PHP files:

$servername = 'localhost';
$db_username = 'root';
$password = '';
$database = 'webdev';

## Also, inside the update_avatar, register, login, login_handler & gather_info PHP files it looks like this:

$con = mysqli_connect("localhost", "root", "", "webdev");

Step 2.1: Replace the parameters with your actual database credentials.

Step 3: Save the changes in each file.

⚠️ Disclaimer: The gather_info.php file logs user entry into your dashboard (IP address and such). If you plan on using this feature, depending on your country's regulations, you may need to include a Cookie Banner. Please note that this is a work in progress and these functionalities have not been added yet. To activate the gather_info.php file, add include 'gather_info.php'; at the beginning of every PHP file you wish to log visits to.

Step 4: Import the Dashboard Database

1. Download and install XAMPP on your local machine. XAMPP is an easy-to-install Apache distribution containing MariaDB (MySQL), PHP, and Perl.
2. Open XAMPP and start the Apache and MySQL services.
3. Navigate to `http://localhost/phpmyadmin` and create a new database. For example, "webdev".
4. Inside the "sql" folder of the extracted source code, you'll find an SQL file (e.g., "webdev.sql").
5. Import this SQL file into the newly created database on phpMyAdmin.```

# The gather_info does create the database it needs itself.

πŸŽ‡ Customize Dashboard Style

  • In the "css" folder of the source code, you'll find the CSS files responsible for the visual style of the dashboard.
  • Open these CSS files in your code editor.
  • You can now modify the colors, fonts, layout, and more to fit your preferences.

🟠 Customize HTML Sections (inside PHP files)

  • Inside the PHP files you will find a HTML section, which dictates the structure and content of the dashboard.
  • Open these PHP files in your code editor.
  • You can now add, remove, or modify sections to suit your needs.

βž• User Registration & Account creation

Please note that no pre-registered accounts are included with the dashboard.

  • New users must register an account through the "register.php" file.
  • Open "register.php" in your code editor and look for the following array of security codes:
$valid_codes = array('dosenbier14', 'sammy098', 'balu881', 'fivemdev001', '1337luna');

Replace the values inside this array with your desired security codes. These codes will be required during registration to prevent unauthorized access.```

βš™οΈ Test Your Dashboard with XAMPP

1. XAMPP provides a perfect environment to locally test your dashboard.
2. Export the SQL file from your FiveM server's database and import it into your local XAMPP MySQL database.
3. Update the database credentials in the PHP files to match your local database settings.
4. Access the dashboard in your web browser by navigating to `http://localhost/<your-dashboard-folder-name>`.
5. You can now experiment with the dashboard, change styles, and test various features without needing to use FTP to a web host.

⚠️ Security Reminder:

If you decide to host the dashboard online, remember to use strong and unique database credentials.