Strange (green) code coming back from the database

1

I have the following PHP query

$mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE);

$mysqli-> set_charset("utf8");

$stmt = $mysqli->prepare("select header, title, footer, head from configs");

$stmt -> execute();

$stmt -> bind_result($header, $title, $footer, $head);

$stmt -> fetch();

echo $header;

But when I give echo in $header the <?=$teste?> code that is in the database comes as an exclamation and two traces before the interrogation, causing the code not to appear, inspecting with visualization that the variable is in green. Why?

    
asked by anonymous 29.07.2014 / 14:45

2 answers

1

If you just run the code you entered, you'll realize that this "green code" (which is a commented PHP code in the middle of your HTML, will not appear.)

I recommend that you open the source code of this page that is running and look for "" and you will find that at some point you commented on this part and forgot!     

29.07.2014 / 22:34
0

The color does not matter, it's just the highlight for tagging the tags like PHP does. I recommend you change <?=$teste?> to <?php echo $teste; ?>

You can see the link link, the 'short tags' are not always enabled.

    
29.07.2014 / 23:01