[FX.php List] problem using email address as username
Andrew Denman
adenman at tmea.org
Mon May 1 08:49:23 MDT 2006
In addition to that, you can use the same syntax that you do in a FileMaker
client to find an exact match. In FileMaker I would type:
=="email at example.com"
In the PHP page, I would add the parameter like so:
$query->AddDBParam('User', '="'.$User.'"', "eq");
Overkill? Probably, but I know it will only return the exact matching
record, which is what you want if using it as a login.
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 Andy Gaunt
Sent: Sunday, April 30, 2006 5:22 PM
To: 'FX.php Discussion List'
Subject: RE: [FX.php List] problem using email address as username
William,
Try escaping the @ in the username with a forward slash '\'.
$User = str_replace('@','\@',$_POST['username']);
$Pass=$_POST['password'];
$layout = fac_web_logon;
$query = new FX ($serverIP, $webCompanionPort);
$query -> SetDBData($webDB,$layout);
$query -> SetDBPassword($webPW,$webUN);
$query ->AddDBParam( 'User', $User,"eq");
$query ->AddDBParam( 'Pass', $Pass ,"eq" );
$queryResult =$query ->FMFind();
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 William Akey
Sent: Sunday, April 30, 2006 6:15 PM
To: FX.php Discussion List
Subject: [FX.php List] problem using email address as username
Hi Folks,
My database is set up with email address as username for web access.
However, I always get a 401 error when I log in with an email address as the
username. With define (DEBUG, true) set, here is the URL that I get:
Using FileMaker URL:
http://jana@pubink.com:password@xxx.xxx.xxx.xxx:80/fmi/xml/FMPXMLRESULT.xml?
-db=SPC_Faculty.fp7&-lay=fac_web_logon&-max=50&dbUser=jana%40pubink.com&dbPa
ss=password&-find
Since I get a 401 error, I assume that access to the database is not the
problem, but rather that the record (which exists) cannot be found. I am
guessing this is because of the way the email address is encoded at the end
of the URL above. That is, the " %40" which replaces the "@" sign that
should be there instead.
I have tried a number of php encoding functions (urlencode, rawurlencode,
utf-8_encode, etc.), but none of them solve the problem. I have also spent a
couple of hours seaching the web, but without finding a solution.
Any ideas how I can solve this problem?
Thanks for any assistance you can offer.
William
_______________________________________________
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