[FX.php List] character encoding issue?
Andy Gaunt
andy at fmpug.com
Thu Feb 16 16:55:21 MST 2006
Kevin,
The following is a very reliable way of using email addresses in finds.
Basically you have to escape out the @ of the email address.
$layout = 'FMLayout';
$query = new FX ($serverIP, $webCompanionPort);
$query -> SetDBData($webDB,$layout);
$query -> SetDBPassword($webPW,$webUN);
$query->AddDBParam( 'email',
str_replace('@','\@',$_REQUEST['username']),"eq" );
$queryResult=$query->FMFind();
The resulting http request would therefore look like
http://##############/fmi/xml/FMPXMLRESULT.xml?-db=#####.fp7&-lay=#######&-m
ax=50&email.op=eq&username=me%5C%40fmpug.com &-find
I have hashed out the request for security issues.
Note the $5C in front of the $40, this is the escape character.
Andy Gaunt
T: 407.810.4722
andy at fmpug.com
http://www.fmpug.com
Recipient of FileMaker's 2005 "Mad Dog" Public Relations Award
For chapter locations, dates & times please visit the website at
http://www.fmpug.com If you can make it to a meeting, please RSVP at
http://www.fmpug.com/rsvp.php
-----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: Thursday, February 16, 2006 5:24 PM
To: FX.php Discussion List
Subject: Re: [FX.php List] character encoding issue?
Hi Kevin,
I believe the @ character is a wild-card character in FMP searches. I
will be staring this problem in the face very soon myself, so I await
the responses from the great people on this list!
Regards,
Dale Bengston
On Feb 13, 2006, at 12:41 PM, kevin wrote:
> Hi,
>
> I'm trying to search a Filemaker table of email addresses via
> FX.php and I'm running into some strange behavior that may be an
> encoding issue.
>
> Basically, it seems like the '@' in the address isn't matching
> because of how it's encoded, although I think the encoding of '%40'
> is correct.
>
> http://myserver.edu/fmi/xml/FMPXMLRESULT.xml?-db=logins.fp7
> &-lay=master&-max=all&master+names::email=myaddress%40mydomain.edu&-
> find
>
> When I omit the '@' and use a wild card instead, I get a match from
> the same table
>
> http://myserver.edu/fmi/xml/FMPXMLRESULT.xml?-db=logins.fp7
> &-lay=master&-max=all&master+names::email=myaddress*&-find
>
> What am I missing here?
>
> Kevin
>
> _______________________________________________
> 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