[thelist] any/all post data
Matt Warden
mwarden at gmail.com
Sun Apr 19 12:53:08 CDT 2009
On Sun, Apr 19, 2009 at 12:20 PM, Bob Meetin <bobm at dottedi.biz> wrote:
> Is there any reasonable way to capture any post data sent to any form on
> a web site without having to redevelop all pages. Adding an include
> would be fine. I'm thinking about setting up some sort of include script
> that will pre-process all data input posted to forms?
You could avoid the need to add an include to every page by simply
using a rewrite rule in .htaccess where you forward all traffic to
preprocess.php, do your thing, and then either buffer in the output of
the original request (for static files) or include() the script of the
original request (php files).
You'll probably be taking a hit on the i/o side of things. It may be
faster to rely on the server fetching and processing the original
request by using some sort of token and two rewrite rules:
if the request URL doesn't start with "/doprocessing" then
do your preprocess.php redirect and capture
in preprocess.php redirect to "/doprocessing$originalRequest"
else
rewrite (not redirect!!!) to $originalReqeust (minus the
/doprocessing part, or you'll get a 404)
end if
--
Matt Warden
Cincinnati, OH, USA
http://mattwarden.com
This email proudly and graciously contributes to entropy.
More information about the thelist
mailing list