I need a Java ServletFilter equivalent in PHP

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
vorius
Forum Newbie
Posts: 8
Joined: Fri Jan 18, 2008 7:05 pm

I need a Java ServletFilter equivalent in PHP

Post by vorius »

In Java, you can specify a class as a ServletFilter and map it in a way that any resource requested on your server would first run your ServletFilter where you can run any code you want and even modify the request/response.

I need something like this for PHP. Is there any equivalent?

I tried the prepend/append php value but this does not work for anything besides php files. For example I need to run this code when a user requests a jpg file from my Apache server, but with the prepend php value it ends up adding the code to the jpg and thus making it not render properly.
Post Reply