April 10, 201312 yr I have a PHP web published site using a FMStudioPro built site and I am getting errors whenever I try to make its user have custom privileges limited to a field (called "On Web") that is a boolean. I have tried On Web = 1 and On Web = "1" and On Web > 0 All I get is that every page on the site jumps to the error page - 404 No records match request I am trying to limit the web results to just records that have the checkbox "On Web" checked. If I remove Custom Privileges, the site works fine, but of course returns all the database's records. thank you! -- Don
April 11, 201312 yr I would control this by making sure the criteria is included in every search from the php, rather than via privileges...
April 12, 201312 yr Author Hello - thank you for the reply -- only thing is I don't seem to be able to get the criteria to work -- I try to limit the results to just the field "On Web" to have a boolean value of 1 with this at the head of the search page - but it always returns everything...: <?php $found_records_find = $macusa->newFindCommand('Web Browse View'); $found_records_findCriterions = array('On Web'=>'=='.@($_REQUEST['On_Web']),); foreach($found_records_findCriterions as $key=>$value) { $found_records_find->AddFindCriterion($key,$value); } fmsSetPage($found_records_find,'found_records',20); $found_records_result = $found_records_find->execute(); if(FileMaker::isError($found_records_result)) fmsTrapError($found_records_result,"error.php"); fmsSetLastPage($found_records_result,'found_records',20); $found_records_row = current($found_records_result->getRecords()); // FMStudio Pro - do not remove comment, needed for DreamWeaver support ?>
April 14, 201312 yr Is the value of 'On_Web' passed in a form or URL? If not, it will be null, so making the request for find everything... Testing version: <?php $found_records_find = $macusa->newFindCommand('Web Browse View'); $onWeb = 1; $found_records_findCriterions = array('On Web'=>'=='.$onWeb,); foreach($found_records_findCriterions as $key=>$value) { $found_records_find->AddFindCriterion($key,$value); } fmsSetPage($found_records_find,'found_records',20); $found_records_result = $found_records_find->execute(); if(FileMaker::isError($found_records_result)) fmsTrapError($found_records_result,"error.php"); fmsSetLastPage($found_records_result,'found_records',20); $found_records_row = current($found_records_result->getRecords()); // FMStudio Pro - do not remove comment, needed for DreamWeaver support ?>
May 1, 201312 yr Author This is fantastic -- thank you -- saved the day. What I realized I was doing wrong, is I was trying to limit it to "onWeb" from the search page, and what I needed to do was add a bit to my results page. I added $onWeb = 1; ro my results page and then changed the array to match your ('On Web'=>'=='.$onWeb,) -- all works perfectly now. My search is passed through a URL in the pages that FMstudioPro set up for me, btw. Thank you again -- Don
May 1, 201312 yr It is worthwhile trying to work out how these things really work - FMStudio is a useful tool but not flexible enough or advanced enough for every situation. And I'm not sure it's really a live product anymore - been a long time since I've seen their dev team post anything...
Create an account or sign in to comment