Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Login verification php

Featured Replies

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...

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...

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();

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.