Jump to content

fmwebby

Members
  • Posts

    11
  • Joined

  • Last visited

fmwebby's Achievements

Apprentice

Apprentice (3/14)

  • First Post
  • Collaborator
  • Conversation Starter
  • Week One Done
  • One Month Later

Recent Badges

0

Reputation

  1. I've created a search form with the FileMaker PHP API as part of an upgrade from a .fp5/CDML site. In the previous site you could click the Enter key on the keyboard and it would execute the search/submit the form if you had clicked outside of any of the search fields (some drop down lists, some normal fields). In the new PHP site the Enter key does not do this when you have clicked outside of the search fields. It does work if the cursor is inside a normal field but not when you click outside. Does anyone know how to get this functionality back so the site continues to function as before in regards to clicking the Enter key on the keyboard when you have clicked outside of any search fields? Thanks, Steve
  2. I've created a site that's working well with the PHP Site Assistant. It sets the search page method to POST - I would like to change that to GET. I gather some changes would be required in the fmview.php page (I can post this if needed) but not sure if this is possible and where to start. Has anyone attempted this before or know what changes to make? Thanks, Steve
  3. I have a site created with the PHP Site Assistant working well that allows users to search from a number of different fields. I would also like to create a number of static links that can be clicked that perform a search based on some static criteria but I'm having trouble either getting the correct URL syntax or overcoming some limitations of how the Site Assistant works that I'm not aware of. All the different URL's that I've tried always return all records. Here's the latest ones that I've tried: http://192.168.0.53/website/recordlist.php?action=find&author=jones&-lop=and&-max=20 http://192.168.0.53/website/recordlist.php?-db=Articles&-lay=web_view&action=find&author=jones&-lop=and&-max=20 If this helps here some details: Database name: Names Web Layout: web_view Record List: recordlist.php Many thanks, Steve
  4. Thanks everyone I got this working now. Here's the code that allowed me to use getFieldUnencoded: <?php $recnum = 1; foreach($records as $key => $record) { $recid = $record->getRecordId(); ?>
  5. OK I've found this code in another include file fmview.php. /* This a wrapper for a FileMaker_Record that checks the find request and encloses any data matching the request in a span marked with the 'found' class. The css files define the look of found items. */ class RecordHighlighter { private $_findRequest; private $_record; function __construct($record, $cgi) { $this->_record = $record; // if there's a stored find request save a reference $find = $cgi->get('storedfindrequest'); if (isset($find)) $this->_findRequest = $find; else $this->_findRequest = NULL; } function getRelatedSet($relationName) { return $this->_record->getRelatedSet($relationName); } function getField($fieldname, $repetition = 0) { // call the inherited version to get the data $result = $this->_record->getField($fieldname, $repetition); $field = $this->_record->getLayout()->getField($fieldname); if(isset($this->_findRequest[$fieldname]) && is_array($this->_findRequest[$fieldname])){ $stringValue = implode("n", $this->_findRequest[$fieldname]); $this->_findRequest[$fieldname] = $stringValue; } if ($this->_findRequest != NULL && !FileMaker::isError($field)) { // if the find request is for a field specified highlight the target if (isset($this->_findRequest[$fieldname]) && strlen($this->_findRequest[$fieldname]) && $field->getResult() != 'date' && $field->getResult() != 'timestamp') { $target = $this->_findRequest[$fieldname]; $replace = "" . $target . ""; $result = str_replace($target, $replace, stripslashes($result)); } } return $result; } function getRecordId() { return $this->_record->getRecordId(); } }; // RecordHighlighter If anyone can explain how this works and what changes are necessary to allow me to use getFieldUnencoded on my recordlist.php page that would be great. Thanks, Steve
  6. Hi thanks for the reply. Do you know how I can find out more information about the RecordHighlighter class? Thanks Steve
  7. I'm having trouble using getFieldUnencoded in a recordlist.php page (it works fine in my browserecord.php page however). If if I have this in my recordlist.php page: <?php echo nl2br( $record->getFieldUnencoded('source_with_URL', 0))?> I get this error when trying to view the page: Fatal error: Call to undefined method RecordHighlighter::getFieldUnencoded() in C:Inetpubwwwrootsiteselected_records.php on line 115 If I change it to: <?php echo nl2br( $record->getField('source_with_URL', 0))?> I don't get the error but I don't see the field, which contains HTML. I suspect the problem related to this at the top of the table (I'm simply viewing the found recorcds from a search): <?php $recnum = 1; foreach ($records as $fmrecord) { $record = new RecordHighlighter($fmrecord, $cgi); $rowclass = ($recnum % 2 == 0) ? "table_row" : "alt_row"; $recid = $record->getRecordId(); $pos = strpos($recid, "RID_!"); if ($pos !== false) { $recid = substr($recid,0,5) . urlencode(substr($recid,strlen("RID_!"))); }?> I've been trying to change this for a few hours now and can't get past this error - can anyone point me in the right direction? Many thanks, Steve
  8. Thanks for the reply. I'm only interested in the submission of dates that the user has entered into a field on the search form. We only allow the user to search on a date field and do not display them on any of the results pages. I've attached the fmview.php (renamed to fmview.txt so I could upload it). It's much more complex that I can deal with at the moment as I'm new to PHP and learning as I go and there's multiple date references in there. If you can see where to make the change I would be very appreciative. Thanks, Steve fmview.txt
  9. I have a date field on a search page that was created with the PHP Site Assistant. I want it to use the DD/MM/YYYY format as that is how the database is setup and all our computers use that date format. I've just discovered by comparing a search via the web browser and a search in the FileMaker database that web searches on the date field are using the MM/DD/YYYY format instead of the DD/MM/YYYY format. On the findrecords.php search page there is this PHP code which I presume is relevant: // formats for dates and times $displayDateFormat = '%d/%m/%Y'; $displayTimeFormat = '%H:%M'; $displayDateTimeFormat = '%d/%m/%Y %H:%M'; $submitDateOrder = 'dmy'; and on the recordlist.php page there is this code which I presume is relevant: // formats for dates and times $displayDateFormat = '%d/%m/%Y'; $displayTimeFormat = '%H:%M'; $displayDateTimeFormat = '%d/%m/%Y %H:%M'; $submitDateOrder = 'dmy'; $record = NULL; $findCom = NULL; This is my first PHP site so I'm learning as I go but would appreciate it if anyone can tell me what changes I need to make to get the search to work in the DD/MM/YYYY format? Many thanks, Steve
  10. Hi, I've used the PHP Site Assistant to create a simple site (this is my first time with PHP and the Site Assistant). On the search page I have several fields that the user can search on, one of them as follows: I would like to modify this so this field is searching for "greater than or equal to" for this Score field automatically behind the scenes (not sure what the default operator is?). I'm not sure where to add the necessary PHP code to make this happen and would appreciate anyone's help with this. Kind regards, Steve
  11. Hi, I'm new to PHP so this will hopefully be a dumb question. I'm using the FileMaker API for PHP. I've created a basic site using the Site Assitant. When you search the database you get the list of found records on the recordlist.php page. When you click to view an individual record details you go to browserecord.php. If you click the Back button in your web browser to logically go back to the list of search results instead of taking you back to your recordlist.php results page at you get the "Webpage has expired" error. Is there a reason for this? How can I go from viewing a specific record back to the list of search results? Thanks, Steve
×
×
  • Create New...

Important Information

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