Re: global find and replace
| From: | James | Date: | Sat, 08 Mar 2003 19:33:52 +0000 |
| Subject: | Re: global find and replace | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-138773@lists.php.net to get a copy of this message | ||
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" <codesmoker@hotmail.com> wrote in message
news:F76USxvjPkQTGpaoG1V00000296@hotmail.com...
> 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
>
> _________________________________________________________________
> Tired of spam? Get advanced junk mail protection with MSN 8.
> http://join.msn.com/?page=features/junkmail
>