[FX.php List] FX.php and textarea problem

Earl Cook ecook at lasersol.com
Wed Feb 22 13:36:08 MST 2006


I have had to create a routine in my FileMaker client that parses all text
before being submitted. Tried the routine Michael uses and it did not work
in all situations. So, I use PatternCount and Substitute on the following
characters...

1    ¹    '
1    Œ    '
1    ³    "
1    ²    "
1    å    a
1    ø    o
1    ë    e
1    é    e
1    ó    o
1    á    a
1    í    i
1    ä    a
1    ö    o
1    ü    u
1    ß    b
1    %     percent
1    ¹s    's
1    ¹t    't

Note that I had to even add 's and 't to the list yesterday. I also know
that there are probably more coming.  The '1' is a flag where I can turn
each character on or off for checking. I built the routine so that I can
send an updated text file and my clients can then simply import it and have
a new set of characters for checking.

In my case, where I am using Troi URL, it simply does not create a record
and will sometimes crash my client, so the problem can be nasty.

Earl Cook

Laser Solutions, Inc.
Technical and Creative Solutions since 1986
Celebrating 20 years March 3, 2006!


on 2/21/06 9:52 PM, Michael Layne at fx at 9degrees.com wrote:

> UPDATE:
> 
> Just got feedback from a colleague that this didn't work as expected.
> Worked for all my testing and does work on another project...
> 
> Your mileage may vary!
> 
> 
> 
> Michael Layne wrote:
>> We had a problem posting from lots of data from a FileMaker client
>> (via Troi URL Plugin) to a PHP page into FM7SA.  We came up with this
>> on the PHP side, and took care of everything...
>> 
>> function convertSmartQuotes($string) {
>>    $search = array(chr(145),
>>                    chr(146),
>>                    chr(147),
>>                    chr(148),
>>                    chr(151));
>> 
>>    $replace = array("'",
>>                     "'",
>>                     '"',
>>                     '"',
>>                     '-');
>> 
>>    return str_replace($search, $replace, $string);
>> }
>> ...then the post...
>>    $q = new FX($ip,$port);
>>    $q->SetDBData($db,$lay);
>>    $q->SetDBPassword('xxxx','xxxx');
>>    foreach ($_POST as $key => $value) {
>>        $realvalue = convertSmartQuotes($value);
>>        $q -> AddDBParam($key, $realvalue);
>>    }
>>    $r = $q->FMNew();
>> HTH!
>> 
>> Michael
>> 
>> Joel Shapiro wrote:
>>> Thanks very much, Derrick.
>>> 
>>> I'll definitely check out magic_quotes, though this time Dale's meta
>>> lines seem to have been the perfect fix for my problem.
>>> 
>>> Best,
>>> -Joel
>>> 
>>> 
>>> On Feb 18, 2006, at 8:05 AM, Derrick Fogle wrote:
>>> 
>>>> Magic_quotes is a PHP setting that automatically escapes quotes,
>>>> apostrophes, and a few other special characters.
>>>> 
>>>> create a file (test.php or something like that) on the server with
>>>> nothing but:
>>>> 
>>>> <? phpinfo(); ?>
>>>> 
>>>> in it, and call it up.
>>>> 
>>>> Look under Configuration -> PHP Core for magic_quotes_gpc. If it's
>>>> not on, that means the characters aren't getting escaped. The
>>>> default setting is for this to be on, if it's not you'll need to
>>>> track down your php.ini file and search for the magic_quotes
>>>> settings. Or, use addslashes() where you need characters escaped
>>>> (but that gets tedious after awhile).
>>>> 
>>>> On Feb 17, 2006, at 5:29 PM, Joel Shapiro wrote:
>>>> 
>>>>> Can you point me to somewhere where I can learn about escaping
>>>>> 'magicquotes'?
>>>> 
>>>> 
>>>> Derrick Fogle
>>>> derrick at fogles.net
>>>> 
>>>> 
>>>> 
>>>> _______________________________________________
>>>> FX.php_List mailing list
>>>> FX.php_List at mail.iviking.org
>>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>> 
>>> _______________________________________________
>>> FX.php_List mailing list
>>> FX.php_List at mail.iviking.org
>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>> 
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
> 
> 
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list




More information about the FX.php_List mailing list