[FX.php List] Re: Re: Mysterious asterisks appearing in fields

Dale Bengston dbengston at preservationstudio.com
Wed Mar 14 13:44:42 MDT 2007


Is this true? I have never changed the magic quotes settings in php.  
Coming from publishing, I understand magic quotes to be the curly  
quotes used in typesetting.

I do not get \\' in my FMP database unless I fail to strip slashes  
for data coming *out* of FMP which is going to be returned to the db.  
For example:

User creates new record, enters the name Digital O'Clock
Data is stored in FMP as Digital O\'Clock
User edits record, stripslashes() is applied to show Digital O'Clock  
in the text input.
Data is stored in FMP as Digital O'Clock

Dale


On Mar 14, 2007, at 2:26 PM, Andrew Denman wrote:

> Addendum: if you control your PHP install, you could also turn 'magic
> quotes' off in php.ini.
>
> Andrew Denman
>
> -----Original Message-----
> From: fx.php_list-bounces at mail.iviking.org
> [mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of Andrew  
> Denman
> Sent: Wednesday, March 14, 2007 2:25 PM
> To: 'FX.php Discussion List'
> Subject: RE: [FX.php List] Re: Re: Mysterious asterisks appearing  
> in fields
>
> The default PHP install has the 'magic quotes' setting turned on (in
> php.ini), which will automatically escape ", ', and \ characters.   
> Since
> Filemaker doesn't require these fields to be escaped to write to the
> database, you will get \", \' and \\ written to your database  
> unless you use
> stripslashes().
>
> http://us3.php.net/manual/en/function.stripslashes.php
>
> Andrew Denman
>
> -----Original Message-----
> From: fx.php_list-bounces at mail.iviking.org
> [mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of Chris  
> Bisgard
> Sent: Wednesday, March 14, 2007 2:17 PM
> To: FX.php Discussion List
> Subject: RE: [FX.php List] Re: Re: Mysterious asterisks appearing  
> in fields
>
> Dale,
>
> I understand that code coming BACK from FMP gets the quotes escaped, I
> just don't quite get why the data going INTO FMP is getting escaped
> quotes. This means, if I understand you correctly, that I need to
> enclose all strings of data going from the web INTO my FMP  
> databases in
> stripslashes(), like this:
>
>   $q->AddDBParam( 'OrgName', stripslashes($OrgName) );
>
> Is that correct? This is the first I've heard this, but I am new to
> using FX.php to enter data (been using it only to search and display
> before this).
>
> Chris
>
>> -----Original Message-----
>> From: fx.php_list-bounces at mail.iviking.org
>> [mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of
>> Dale Bengston
>> Sent: Wednesday, March 14, 2007 12:11 PM
>> To: FX.php Discussion List
>> Subject: Re: [FX.php List] Re: Re: Mysterious asterisks
>> appearing in fields
>>
>> Chris,
>>
>> Yes, that is expected. It's actually a good thing, because
>> un-escaped single and double quotes could cause havoc with
>> your code coming back in from FMP.
>>
>> My two best friends for formatting strings from FMP are stripslashes
>> () and nl2br(). Often used in conjunction!
>>
>> Dale
>>
>> On Mar 14, 2007, at 2:02 PM, Chris Bisgard wrote:
>>
>>> Dale, just to be clear, the slashes are also appearing in the
>>> FileMaker database, not just when displaying data back to
>> the web. Is
>>> that expected?
>>>
>>> Chris
>>>
>>>> Darn, that's expected behavior, and not a clue to the asterisks.
>>>> You'll need to use stripslashes() to address display of such data
>>>> back to the web.
>>>>
>>>> http://us2.php.net/manual/en/function.stripslashes.php
>>>>
>>>> Dale
>>>>
>>>> On Mar 12, 2007, at 8:39 PM, Chris Bisgard wrote:
>>>>
>>>>> A possible clue... if I enter single or double quotes in a field,
>>> each
>>>>> one ends up with a backslash in front of it in the data.
>> Looks like
>>> an
>>>>> escape character. Page encoding to blame?
>>>>>
>>>>> Chris
>>>
>>>
>>>
>>> _______________________________________________
>>> 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
>
> _______________________________________________
> 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