Final version [php] function

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Todd_Z
Forum Regular
Posts: 708
Joined: Thu Nov 25, 2004 9:53 pm
Location: U Michigan

Final version [php] function

Post by Todd_Z »

Is the function for coloring [.php] code publicly available?

Code: Select all

if ( code->isPubliclyAvailable() )
  askWhereIsCode();
Thanks.
Revan
Forum Commoner
Posts: 83
Joined: Fri Jul 02, 2004 12:37 am
Location: New Mexico, USA
Contact:

Post by Revan »

Name the code .phps
User avatar
Todd_Z
Forum Regular
Posts: 708
Joined: Thu Nov 25, 2004 9:53 pm
Location: U Michigan

Post by Todd_Z »

mmm... then look at it in a browser... i presume, but firefox prompted me with a download - am i missing something
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post 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
User avatar
Todd_Z
Forum Regular
Posts: 708
Joined: Thu Nov 25, 2004 9:53 pm
Location: U Michigan

Post by Todd_Z »

If i'm not hosting myself, how could i go about doing that to the http.conf?
Revan
Forum Commoner
Posts: 83
Joined: Fri Jul 02, 2004 12:37 am
Location: New Mexico, USA
Contact:

Post by Revan »

In an .htaccess in the folder your .phps is, put

Code: Select all

AddType application/x-httpd-php-source .phps
should work.
User avatar
Todd_Z
Forum Regular
Posts: 708
Joined: Thu Nov 25, 2004 9:53 pm
Location: U Michigan

Post by Todd_Z »

unfortunately that was unsuccessful
Revan
Forum Commoner
Posts: 83
Joined: Fri Jul 02, 2004 12:37 am
Location: New Mexico, USA
Contact:

Post by Revan »

Try this:

Code: Select all

highlight_file("file.php");
User avatar
Todd_Z
Forum Regular
Posts: 708
Joined: Thu Nov 25, 2004 9:53 pm
Location: U Michigan

Post by Todd_Z »

that worked, i mean the AddType in htaccess didn't work. (sorry for the ambiguity)
Post Reply