Forum Moderators: coopster

Message Too Old, No Replies

Show php code in browser

Like a pastebin

         

finoo

9:41 pm on Jan 12, 2009 (gmt 0)

10+ Year Member



Hi

I can't seem to find the correct solution, but my guess is that is is a simple one ;)

My question : I WANT to see the php code in the browser (like you see in a pastebin).
Can someone give me a clue for what im looking for, or a google searchterm to get me on track ?

eelixduppy

9:49 pm on Jan 12, 2009 (gmt 0)



Don't surround it with
<?php
and
?>
tags and change everything to HTML entities and you should be set.

You can also change the extension to a PHP file to

.phps
and it should work as a PHP Source file and display highlighted in the browser. Lastly, there is a PHP function that shows and highlights the source if need be: [php.net...]

finoo

10:46 pm on Jan 12, 2009 (gmt 0)

10+ Year Member



Good idea, but the stuff i want to echo out is in the database ;)

I'll take a look at [no.php.net...]

ag_47

12:49 am on Jan 13, 2009 (gmt 0)

10+ Year Member



Add

header('Content-type: text/plain');

at the top :)