473,473 Members | 1,491 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

PHP - Preprocessing Filters using wildcards on URL path

Dearest Colleagues,

I was suddenly having a sharp pain in locating information about a
design capability in PHP that exists in Java servlets.

In Java, I can preprocess, via a filter, some HTTP requests before
answering to the client. Please allow me to show and example since it
will illustrate the point well.

User types: http://domain.com/myapp/restofpath.html
In a Java servlet, there exists a web-app which maps /myapp/* to a
cookie checking filter before routing it to restofpath.html.

Of course, the filter could do many other actions, so the method of
interest here is whether there is any similar thing that may be
achieved with PHP? Also if anyone knows what it would be called I'd
appreciate, so web searches turn up better results to me.

So it boils down to, in PHP how can I route all paths matching a
pattern to a PHP script prior to them serving the page immediately?
the end result is not a single script, however I'd like all the
requests to go through a single script prior to hitting the resulting
page.

User types: http://domain.com/myapp/restofpath.html
User types: http://domain.com/myapp/adifferentpath.html
User types: http://domain.com/myapp/garycoleman.html

The objective would be to route all these through myfilter.php to pre-
process the request (and maybe do things like cookie processing, page
view counters, and http header info)

Thank you for your time and thoughts!

Jul 4 '07 #1
1 2159
TATrader wrote:
Dearest Colleagues,

I was suddenly having a sharp pain in locating information about a
design capability in PHP that exists in Java servlets.

In Java, I can preprocess, via a filter, some HTTP requests before
answering to the client. Please allow me to show and example since it
will illustrate the point well.

User types: http://domain.com/myapp/restofpath.html
In a Java servlet, there exists a web-app which maps /myapp/* to a
cookie checking filter before routing it to restofpath.html.

Of course, the filter could do many other actions, so the method of
interest here is whether there is any similar thing that may be
achieved with PHP? Also if anyone knows what it would be called I'd
appreciate, so web searches turn up better results to me.

So it boils down to, in PHP how can I route all paths matching a
pattern to a PHP script prior to them serving the page immediately?
the end result is not a single script, however I'd like all the
requests to go through a single script prior to hitting the resulting
page.

User types: http://domain.com/myapp/restofpath.html
User types: http://domain.com/myapp/adifferentpath.html
User types: http://domain.com/myapp/garycoleman.html

The objective would be to route all these through myfilter.php to pre-
process the request (and maybe do things like cookie processing, page
view counters, and http header info)

Thank you for your time and thoughts!
You can't. All you can do is include the code in the appropriate files.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jul 4 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Fernando Rodriguez | last post by:
Hi, How can I check for the xistence of any file that matches a wildcard? For example: ppis-*.iss os.path.exists() doesn't expand the wildcard...
5
by: utabintarbo | last post by:
I have a path spec similar to '/home/*/.mozilla/*/*/cache*/*' (this will probably look familiar to *nix users) with multiple wildcards. I am finding it difficult gathering ALL file pathnames which...
17
by: mike | last post by:
i'd like to use os.access(path,mode) where path may contain linux style wildcards. i've failed so far. my workaround is the bash command. os.system('' % fn )
10
by: Alvaro Puente | last post by:
Hi all! Do any of you know if wildcards are accepted when calling rename() function? Thanks/Alvaro
0
by: ChadDiesel | last post by:
Hello Everyone, I have a field set up in a table that is an OLE object with a link to an external Excel spreadsheet. My question is whether you can use a file path that contains wildcards. ...
20
by: jvankay | last post by:
Does any C guru out there know of a C pre-processing tool that will allow limited pruning of C source based on a single #define variable. That is, in the code fragment below: XXX #ifdef...
0
by: DotNetJunkies User | last post by:
I have data in my DataTable that lists multiple values in the Roles column which are space separated like this: " AM AMB MCS DIO CO PM3 CAM " I need to be able to query on this column to get back...
9
by: Ron | last post by:
Hello, Is it required to use Imports System.Runtime.InteropServices to run C++ API code? I ask because I thought I read somewhere that this was required. If it is not required would it...
2
by: shredder249 | last post by:
Hi, I have a form that loads with a filter: Me.Filter = "Format = 'Digital'" Me.FilterOn = True This filter works fine. Each "Digital" record has a filepath field which is...
5
by: Francois Grieu | last post by:
One of the C compiler that I use <OT>(Keil's CX51)</OTbarks at #define a(b) b int main(void){return a( #if 0 #endif 0);} More generally, this compiler seems confused by any preprocessing...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.