RE: [PHP-GENERAL] printing a php file as a text file

From: Date: Mon, 22 May 2000 15:01:16 +0000
Subject: RE: [PHP-GENERAL] printing a php file as a text file
References: 1  Groups: php.general php.general 
Request: Send a blank email to php-general+get-289@lists.php.net to get a copy of this message
It might be because the browser doesn't know what kind of data "php[3]-source" is, so it can't display it and tries to download it. Just tell it that php3 is text and it should show it. -------------- Todd Smith Perl/PHP/SQL DesignSouth (334) 501-4664 ICQ# 2403013 todd@designsouth.com -----Original Message----- From: Chris Sano [mailto:sano@mail.rit.edu] Sent: Saturday, May 20, 2000 12:08 PM To: php-general@lists.php.net Subject: RE: [PHP-GENERAL] printing a php file as a text file I put the below in my httpd file: AddType application/x-httpd-php[3]-source .phps It doesn't show the code in the browser window, but rather forces the user to download the script. I want the user to be able to VIEW this in his/her browser with the approprimate syntax. I tried show_source() too, but that put everything on one line.. unless I did something wrong? chris -----Original Message----- From: jon@mail.csh.rit.edu [mailto:jon@mail.csh.rit.edu]On Behalf Of Jon Parise Sent: Thursday, May 18, 2000 10:36 AM To: php-general@lists.php.net Subject: Re: [PHP-GENERAL] printing a php file as a text file On Thu, May 18, 2000 at 02:07:14AM -0400, Chris Sano wrote: > How would I go outputting my PHP file as a text file -- for > example, I have a set of scripts that I plan to release to the > public and would like to make this script viewable through PHP > without having to call a text file. I know I have seen this > somewhere and I'm wondering if any of you guys know how to do > this.. You can take advantage of php's ability to perform it's own syntax highlighting on php source code. Assuming you configured the content handler for application/x-httpd-php[3]-source: % ln -s index.php index.phps The .phps extensions is the default extension for php source. If the user browses a .phps file, php will output the source code with syntax highlighting. -- Jon Parise (jon@csh.rit.edu) . Rochester Inst. of Technology http://www.csh.rit.edu/~jon/ : Computer Science House Member -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#289) next »