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

Andrew Denman adenman at tmea.org
Wed Mar 14 13:24:49 MDT 2007


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



More information about the FX.php_List mailing list