diff options
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | README.md | 4 | ||||
-rw-r--r-- | config.example.ini | 5 | ||||
-rw-r--r-- | includes/db_inc.php | 10 |
4 files changed, 11 insertions, 11 deletions
@@ -1 +1,2 @@ -.vscode
\ No newline at end of file +.vscode +config.ini
\ No newline at end of file @@ -1,4 +1,6 @@ # cflip.net forums The source code to my first PHP project, a forum system. -The `setup.sql` should set up the database correctly. +## Setup +- Create a `config.ini` file and put your MySQL credentials in (see `config.example.ini`) +- `setup.sql` has the SQL script to set up your database. diff --git a/config.example.ini b/config.example.ini new file mode 100644 index 0000000..c587a63 --- /dev/null +++ b/config.example.ini @@ -0,0 +1,5 @@ +[mysql_credentials] +server = "" +database = "" +user = "" +password = ""
\ No newline at end of file diff --git a/includes/db_inc.php b/includes/db_inc.php index 10740d8..b7c361d 100644 --- a/includes/db_inc.php +++ b/includes/db_inc.php @@ -1,13 +1,5 @@ <?php -/* -# Example config values -[mysql_credentials] -server = "localhost" -database = "forum" -user = "root" -password = "admin" -*/ -$cfg_ini = parse_ini_file('/var/www/cflip.ini', true); +$cfg_ini = parse_ini_file('config.ini', true); $dbcfg = $cfg_ini['mysql_credentials']; $db_server = $dbcfg['server']; |