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

Michael Layne fx at 9degrees.com
Tue Feb 21 00:07:51 MST 2006


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



More information about the FX.php_List mailing list