Is it possible to see PHP code after loading page in PHP Posted January 7, 2017 As a user of a website, like my own, is it possible to see the code that has been used on a page? I was wondering about it because the following code would be visible, and I assume giving my database password to everyone would be a terrible thing to do. <?php$servername = "localhost";$username = "username";$password = "password";// Create connection$conn = new mysqli($servername, $username, $password);// Check connectionif ($conn->connect_error) { die("Connection failed: " . $conn->connect_error);} echo "Connected successfully";?>
Is it possible to see PHP code after loading page
in PHP
Posted
As a user of a website, like my own, is it possible to see the code that has been used on a page?
I was wondering about it because the following code would be visible,
and I assume giving my database password to everyone would be a terrible thing to do.
<?php
$servername = "localhost";
$username = "username";
$password = "password";
// Create connection
$conn = new mysqli($servername, $username, $password);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
?>