Protect content from php files?

Asked

Viewed 30 times

1

I don’t know if I’m doing it right, but I have a file called Setting.php in my project, but I’m not sure that it is protected because it contains the login information of the Cpanel admin, so if someone has access to it they will have access to all the files and even DB, Should I change any permissions on that file? or just something like:

ini_set('display_errors',0);
ini_set('display_startup_erros',0);
function conectar(){
    try{
        $pdo=new PDO ("mysql:host=localhost;dbname=testlogin","root","");
    }catch(PDOException $e){
        echo $e->getMessage();
    }
    return $pdo;
}

Would be enough?

  • I do not know if I understood very well the post, but as far as I saw the configuration file in this style I presented would be ideal then?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.