removed config.php

This commit is contained in:
Zdenek Borovec 2024-05-07 18:05:21 +02:00
parent 19f3cb4cf7
commit 406c1298d6
3 changed files with 10 additions and 23 deletions

View file

@ -20,10 +20,16 @@ Anyways, let's get to the *how*.
- The database is documented through comments viewable in phpmyadmin,
if you have trouble displaying them in your database manager, let me know
and I might get to writing some basic setup instructions here.
- In the file `docs/common/config.php` you can set the connections to your
database that will then be used in `docs/common/header.php`
to connect to it and set the global variable `$conn` to the PDO
- Please create the file `docs/common/config.php` which will store database
credential that will then be used in `docs/common/header.php`
to connect to the db and set the global variable `$conn` to the PDO
connection object, you can use that in your own functions, if you add any.
- The file should define the following constants:
- SQL_HOSTNAME
- SQL_USERNAME
- SQL_PASSWORD
- SQL_DATABASE
- Remember to enable pdo_mysql in yourr php.ini.
- If you have problems connecting to the database, you can try
printing the PDO exception being caught there in the function
`attempt_sql_connect()`, but be careful not to leave it in production, as

View file

@ -1,19 +0,0 @@
<?php
/**
* This file is for storing your personal information (such as database login).
* These constants will be most likely used in header.php
* for logging in to different internal services.
* It is critical that if you enter your details here,
* you do not commit the changes into any public repository.
* In the original repository [https://github.com/Zeftax/personal-homepage.git]
* this file is set to not track any changes, but it is better to check and
* be safe, than leak your internal logins and have people screwing with
* your database.
*/
// SQL database login info (Place your info here).
define("SQL_HOSTNAME", "");
define("SQL_USERNAME", "");
define("SQL_PASSWORD", "");
define("SQL_DATABASE", "");
?>

View file

@ -68,7 +68,7 @@ function attempt_register($conn, $username, $password, $passwordConf) {
// set errors, old values, and return.
if($result || strtolower($username) == "[deleted]" ||
strtolower($username) == "[guest]" ||
strtolower($username) == "zeftax") {
strtolower($username) == "zdenek") {
$usernameErr = "This username is not available";
$usernameOld = $username;
$passwordOld = $password;