A
A
A person from Kazakhstan2016-12-31 08:47:37
PHP
A person from Kazakhstan, 2016-12-31 08:47:37

How can I get access to the site's source code?

For example, there is such a structure:

<?php  
$host = "localhost";
$oser = "root";
$pass = "123";
$dbname = "news";

$conn = new mysqli($host, $oser,$pass,$dbname);
if(!conn) die ("описание " . $conn->connect_error);
$sql = "SELECT * FROM `news`";
$result = $conn->($sql);
?>
<!DOCTYPE HTML>
<html lang="ru">
<head></head>
и т д

And if you look through the code inspector in the browser, then everything between the tags <?php ?>is not visible. But this is considered bad manners and not safe. The question itself is: how can an attacker see this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xmoonlight, 2016-12-31
@LenovoId

He will not see it in any way (without having access to the file system on the server, of course).
About the bad tone - it needs to be separated: the output template is always separated from the main code.
About safety - fairy tales.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question