Actually, in this case str_replace() would be preferred over preg_replace,
as it would be faster.

foreach($_REQUEST AS $key => $val)
{
  $_REQUEST[$key] = str_replace(';', '', $val);
}


mh.

On Sat, 8 Mar 2003, James wrote:

> Add an append file to the php.ini file, this script will act the default
> loader before any other php action.
>
> parse $HTTP_POST_VARS and $HTTP_GET_VARS and $HTTP_FILES or whatever you
> want
> Parsing the POST_VARS and GET_VARS will mean you will not have to worry
> about variable names
>
> dont use eregi_* use preg.
>
> var = preg_replace("/;/i","", $var);
>
> jim.
>
>
>
>
> "Didier McGillis" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > I have to remove all semi-colons from user input fields that will be sent
> > down to our backend system, semi-colons are the delimiter in the messages
> > that flow from ur website to our backend system.  How I need this to work
> is
> > not client side but server-side in our pages, I need to do this in the
> least
> > system taxing and easiest to implement.  There are many many files and
> > fields that find their way into the system.  I dont necessarly want a PHP
> > function.  I am looking for a best pratice for doing a global removal.
> >
> > Here are the three approaches that I have thought of, although there is
> > another one but that is outside my scope as it requires me touching out
> C++
> > componets.
> >
> > 1.  Down and dirty make a function that will strip each field when it is
> > going through its normal validation.  Time consuming and taxing of the
> > system.
> >
> > 2.  Strip the semi colons on their way in to the functions that interact
> > with the C++ components.
> >
> > 3.  Strip them in the JSI component, which is the layer between JS and
> C++.
> >
> > 4.  I had thought of stripping the semi-colons in the C++ components
> myself,
> > I thought that would be the best, doing a strip, but I dont know C++ very
> > well and I dont know the best way or any way to do that.
> >
> > Okay you have seen my four obviously briliant ideas, do you have one or do
> > you have a way of doing this task easly and quickly.
> >
> > Please help



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to