I would like to instantiate a connection in PHP and do not show the values as an example user and password, if you use print_r (new nomedaclasse) the values are shown even using the private modifier. Is it possible to omit information such as user and password values? Here's part of the code:
private $host="localhost";
private $user="root";
private $password="";
private $dbname="test";
private function setLogin($l, $s){
$conn = new PDO("mysql:host=$this->host;dbname=$this->dbname","$this->user", "$this->password");
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$conn = $conn->prepare("SELECT login, senha FROM usuario where login = :login and senha = :senha");
$conn->bindParam(':login', $l, PDO::PARAM_STR);
$conn->bindParam(':senha', $s, PDO::PARAM_STR);
$conn->execute();
$linha = $conn->fetch(PDO::FETCH_ASSOC);
if($linha == ""){
echo "false";
}else{
session_start();
echo $_SESSION["logado"] = md5(uniqid(rand(), true));
}
}