Jump to content

Is it possible to see PHP code after loading page


One_Step

Recommended Posts

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";
?>

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...