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 and restricted record access

Featured Replies

  • Newbies

hello,

I've got a FM database up and running with PHP Site Assistant but now i want clients to be able to login to the database and only see the records that have the same Client_ID, how do i do that ?

Kind Regards,

Zero

Have you tried setting up custom record level access permissions in Accounts & Privileges?

Hi Zero

I'm a relative newcomer to PHP, so this is meant to point you in the right direction.... I'm sure other more experienced contributors will be able to help further.

I wanted to do something similar with our solution, and allow select clients the ability to see events they had booked into our system. My solution works something like this:

1) I have a web-specific "Contacts_Web" table in the filemaker database, which shows only the fields I need online – Contact_ID, Contact_Name etc..

2) 'Events' are related records (by Contact_ID) in a separate table in the Filemaker database which are displayed in a portal on the Contacts_Web layout

I'm passing a variable via the URL to find contacts by their ID – e.g. http://host/contacts.php?contactid=1234

The basic following code 'gets' the variable from the URL, and performs a find.....


$req = $fm->newFindCommand("tableNameHere");	

$req->addFindCriterion("Contact_ID", $_GET['contactid']);

$result = $req->execute();

$records = $result->getRecords();





..and the PHP page includes a portal to show related events for that client.



It seems to me that you could use a very similar find request based on the username....





$req = $fm->newFindCommand("tableNameHere");	

$req->addFindCriterion("Contact_ID", $username);

$result = $req->execute();

$records = $result->getRecords();

Here, you wouldn't need to pass any variables in the URL (so it's just plain old .../contacts.php) since the $userName variable is defined at the start of the page, (along with the other authentication and server/database details). I'm assuming of course that your Contact_ID field contains (or could contain) the same data as a account username setup for PHP access.

It's not a complete solution, but I hope this points you in the right direction and is somewhat helpful!

Cheers.

Edited by Guest

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.