FRIHOSTFORUMSSEARCHFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Show PHP Code

 


yule
Hello all,

Some websites like php.net allow you to see there source code. Well here is how you can do it on your website. It is very simple and give syntax higlighting and all. Just use the following code to show the source code of a file on your website.

Code:

<?php
show_source("filename.php");
?>



Then just save the file to your webserver and try it out. It should hilight all the PHP code and of course show the code. Enjoy!
izcool
The other alternative to that is by renaming the page to ".phps" (PHP Source). It highlightes the syntax in colors for easy reading. I believe you have to add a new Apache module and enable it in the PHP configuration for it to work properly. Confused

- Mike.
Related topics

PHP Tutorial: Basic Shoutbox w/ MySQL
PHP CODE INCLUSION
mySQL Query/PHP code - get the highest value...
my PHP code benchmark script that got some problems
PHP code snippit?

CSS for making images go through a php code.
Gradient Fill Cell
What is a good or bad php code?
Securing your php code
I want PHP Code to ......

PHP Code to HTML
Php code messed up. What's wrong?
php variables
PHP Validation Class
How To : Improve Your PHP Programming
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.