Recently I have started learning PHP. I have created website that uses single PHP file (ex. config.php) to keep inside it database info, passwords etc.
For example, my config.php looks like that:
<?php
return array(
"ip"=>"localhost",
"user"=>"rootusr",
"password"=>"abc",
);
?>
I am accessing to this from other files by $conn = include("config.php");
and echo $conn[ip];
etc.
My question is:
IS IT SAFE METHOD? Is anyone able (excluding me) to access this data from other server? To include my config.php and use it on his own? How can I do it better or make it safer?
Thanks for help! :)