Displaying Code on the Web
Posted by mkhairul - April 29, 2008 at 01:04:29 pm -Categories: blog
There's multiple ways to display code, using whatever highlighter you
want (GeSHi, Google Syntax Highlighter), .phps extension (if your
hosting supports it), and many more.
Since the HTML text editor automagically encode characters, so I added an option to download the file.
I've added a download script which will allow users to download files.
PHP:
-
$mm_type="application/octet-stream";
-
-
$file = '';
-
$filename = '';
-
-
$filename = $_GET['download'];
-
switch($filename){
-
case "truncate":
-
$file = "truncate.php";
-
break;
-
case "download":
-
$file = "download_sample.php";
-
break;
-
}
-
-
-
-
-
April 29, 2008 | In blog |
No Comments yet »
RSS feed for comments on this post. TrackBack URI
Leave a comment
Powered by WordPress with GimpStyle Theme design by Horacio Bella.
Entries and comments feeds.
Valid XHTML and CSS.
