Jump to content

readfile() without executing HTML code


Recommended Posts

In a PHP file [php_one.php], I wrote some PHP code that contained a form.  I used ECHO to write the HTML inside of the PHP tags.

On another PHP page [php_two.php], I wanted to show the code that was used to create the first page [php_one.php].

My first effort provided an interesting result, since the PHP code was readable.  However, all HTML code was visible in its executed form.

There was an actual input field and a submit button (not the code used to produce them) in the context of my coding.

I have tried using:

$array = file("FILE")

All results were similar and carried the same problem.

How can I view code so that even the HTML is visible as code?

Link to comment
Share on other sites

This thread is more than a year old. Are you sure you have something important to add to it?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.