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:
7
db_info.php
Normal file
7
db_info.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
//Database info - (for loclhost)
|
||||
$hostname = "localhost";
|
||||
$username = "root";
|
||||
$password = "";
|
||||
$database = "neosubhamoy";
|
||||
?>
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user