Page 1 of 1

Final version [php] function

Posted: Wed Apr 27, 2005 4:07 pm
by Todd_Z
Is the function for coloring [.php] code publicly available?

Code: Select all

if ( code->isPubliclyAvailable() )
  askWhereIsCode();
Thanks.

Posted: Wed Apr 27, 2005 4:51 pm
by Revan
Name the code .phps

Posted: Wed Apr 27, 2005 4:55 pm
by Todd_Z
mmm... then look at it in a browser... i presume, but firefox prompted me with a download - am i missing something

Posted: Wed Apr 27, 2005 4:58 pm
by timvw
it also requires you to have something like

AddType application/x-httpd-php-source .phps

in your httpd.conf



an alternative is the http://www.php.net/higlight_string function

Posted: Wed Apr 27, 2005 5:04 pm
by Todd_Z
If i'm not hosting myself, how could i go about doing that to the http.conf?

Posted: Wed Apr 27, 2005 5:14 pm
by Revan
In an .htaccess in the folder your .phps is, put

Code: Select all

AddType application/x-httpd-php-source .phps
should work.

Posted: Wed Apr 27, 2005 5:18 pm
by Todd_Z
unfortunately that was unsuccessful

Posted: Wed Apr 27, 2005 5:37 pm
by Revan
Try this:

Code: Select all

highlight_file("file.php");

Posted: Wed Apr 27, 2005 6:01 pm
by Todd_Z
that worked, i mean the AddType in htaccess didn't work. (sorry for the ambiguity)