September 8, 200916 yr 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
September 9, 200916 yr Have you tried setting up custom record level access permissions in Accounts & Privileges?
September 9, 200916 yr 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 September 9, 200916 yr by Guest
Create an account or sign in to comment