1
1
mirror of https://github.com/neosubhamoy/neosubhamoy-portfolio.git synced 2025-12-19 22:53:03 +05:30

(refactor): secured database credentials from public access

This commit is contained in:
2023-12-02 23:25:10 +05:30
parent 5884e58b07
commit a53143f74c
2 changed files with 10 additions and 5 deletions

7
db_info.php Normal file
View File

@@ -0,0 +1,7 @@
<?php
//Database info - (for loclhost)
$hostname = "localhost";
$username = "root";
$password = "";
$database = "neosubhamoy";
?>

View File

@@ -1,10 +1,8 @@
<?php
//Connect with Database
$hostname = "localhost";
$username = "root";
$password = "";
$database = "neosubhamoy";
//Collect database info
require '../db_info.php';
//Connect with Database
$conn = new mysqli($hostname, $username, $password, $database);
if ($conn -> connect_error) {