-1

I'm running XAMPP on my computer. I build an index.php and store it under xampp/htdocs/domain folder.

Everything works fine for me. But when I click view source, I still can see through all my PHP code and especially MySQL database password. Is that normal? what should I do?

<?php
include("header.php");
//phpinfo();
if (isset($_GET['aid']) && is_numeric($_GET['aid'])) {
    $aid = (int) $_GET['aid'];
} else { $aid = 1; }
// mysqli $mysqli = new mysqli($dbhost, $dbuser, $dbpassword, $dbdatabase); 
$result = $mysqli->query("SELECT entries.*, categories.cat FROM entries, categories WHERE entries.cat_id = categories.id ORDER BY dateposted asc limit 0,5");
$row_12 = $result->num_r

My website is working at all. Only when I click 'view source' on the successful page, it show all my php code and MySQL statement.

To my point of view, it should show the html syntax instead. It's like the rendering is not working at all. I'm working with XAMPP v3.2.2 and I'm viewing my website using localhost/domain.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129

1 Answers1

0

If the code is not in tag it will be shown, make sure you have this on the start and end also make sure you don't have any comment indicators

Anil KB
  • 1
  • 2
  • my website is working well. no problem with the website. but when i click 'view source' on the page, it show my php and MySQL statement. it's like the rendering is not working at all. – Peter malcolm Oct 23 '16 at 07:02