mirror of
https://github.com/neosubhamoy/neosubhamoy-portfolio.git
synced 2025-12-20 03:29:35 +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
|
<?php
|
||||||
//Connect with Database
|
//Collect database info
|
||||||
$hostname = "localhost";
|
require '../db_info.php';
|
||||||
$username = "root";
|
|
||||||
$password = "";
|
|
||||||
$database = "neosubhamoy";
|
|
||||||
|
|
||||||
|
//Connect with Database
|
||||||
$conn = new mysqli($hostname, $username, $password, $database);
|
$conn = new mysqli($hostname, $username, $password, $database);
|
||||||
|
|
||||||
if ($conn -> connect_error) {
|
if ($conn -> connect_error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user