Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 5419 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi all,

I have been creating a php script that would get a username and password, then authenticate against filemaker by running a command and check to see if an error is return. My code is below:

$errorcode ="";

$errorcheck ="";

require_once('Filemaker.php');

require_once('FileMaker/server_data.php');

$lcc = new FileMaker('lcc_applications_.fp7', $serverIP, $_POST['name'], $_POST['pwd']);

$record = $lcc->listLayouts();

if(FileMaker::isError($record))

{

$errormsg = " Incorrect username or password";

$errorcheck = $errorcheck."1";

}

else

{

$errorcheck = $errorcheck."0";

}

if($errorcheck=="0" && empty($errorcode))

{

echo "

";

echo "you are log in successfully";

die();

}

The code seem to be pretty simple but the "FileMaker::isError($record)" always return true for some reason with correct or incrorrect username and password. Does anybody know why this code does not work? Any help would be appreciated.

Thanks, Kevin Dang.

  • 4 weeks later...
Posted

I've not tried authentication in this manor, I've just kept a set of records in the database for username/passwords (with the password encrypted by the sha1 function)...

I'd try declaring the username/passwords as a variable prior to the $lcc statement:

$username = $_POST['username'];

$password = $_POST['pwd'];

$lcc = new FileMaker('lcc_applications_.fp7', $serverIP, $username, $password);

It may also be worth putting in a :)

echo FileMaker::isError($record);

statement in prior to the if statement to see what is coming out?

  • 2 weeks later...
Posted

You should probably take a look at the error being returned...


$errorcode ="";

$errorcheck ="";



require_once('Filemaker.php');

require_once('FileMaker/server_data.php');



$lcc = new FileMaker('lcc_applications_.fp7', $serverIP, $_POST['name'], $_POST['pwd']);



$record = $lcc->listLayouts();



if(FileMaker::isError($record))

{

echo $record->getCode()." ".$record->getMessage()."
";

$errormsg = "";

$errorcheck = $errorcheck."1";

}

else

{

$errorcheck = $errorcheck."0";

}



if($errorcheck=="0" && empty($errorcode))

{

echo "

";

echo "you are log in successfully";

die();

This topic is 5419 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.