You are here: Re: PHP - Preprocessing Filters using wildcards on URL path « PHP Programming Language « IT news, forums, messages
Re: PHP - Preprocessing Filters using wildcards on URL path

Posted by Jerry Stuckle on 07/04/07 03:07

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.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация