php - Value of stream_get_contents isn't actual value -



php - Value of stream_get_contents isn't actual value -

i'm trying create online editor cms panel. if click on file online file returned me php/html etc. in it. problem when utilize function stream_get_contents i'm not getting want...

this php part file:

$fileadresroot = $_server['document_root']; if(empty($_get['name'])) { header('location: ftp-directory'); exit(); } else { $filename = trim($_get['name']); $fileadres = $fileadresroot.'/'.$filename.''; } if(isset($_get['doublename'])) { $filemaps = trim($_get['doublename']); $fileadres = $fileadresroot.'/'.$filemaps.'/'.$filename.''; } $filecontents = fopen($fileadres, 'rb', false); $filecontent = stream_get_contents($filecontents);

i'm echoƫing $filecontent this:

<pre id="editor"><?php echo $filecontent; ?></pre>

so needs give me this, needs show me this:

<?php $getpage = 'blog beheren'; include_once 'includes/header.php'; /* starting selecting blog info , post database. */ if (isset($_get["page"])) { $page = trim($_get["page"]); } else { $page=1; } $start_from = ($page-1) * 5; $stmt = $mysqli->prepare("select id, datum, auteur, comments, titel blog order id desc limit ?, 5"); $stmt->bind_param('s', $start_from); $stmt->execute(); $stmt->store_result(); $stmt->bind_result($blogid, $blogdatum, $blogauteur, $blogcomments, $blogtitel); $intblog = $mysqli->query("select id blog")->num_rows; ?> <!-- matter --> <div class="matter"> <div class="container"> <div class="row"> <div class="col-md-12"> <div class="widget"> <div class="widget-head">

but instead it's showing me this:

prepare("select id,datum,comments,tags,titel,omschrijving,image,auteur blog order id desc limit ?,5"); $stmt->bind_param('i', $start); $stmt->execute(); $stmt->store_result(); $stmt->bind_result($blogid, $blogdate, $blogcomments, $blogtags, $blogtitle, $blogdesc, $blogimg, $blogauth); $intinfo = $stmt->num_rows; ?> home blog blog

so not html div's etc not shown,

i believe happening string not beingness encoded display html entities, , beingness rendered actual html.

with going for, want echo file contents htmlentities function

so this:

<?php echo htmlentities($filecontent, ent_html5); ?>

php

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -