<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
   <channel>
      <title>FileMaker</title>
      <link>http://blog.lib.umn.edu/froye001/filemaker/</link>
      <description>FileMaker User Group for the University Community</description>
      <language>en</language>
      <copyright>Copyright 2012</copyright>
      <lastBuildDate>Tue, 04 Oct 2011 09:56:37 -0600</lastBuildDate>
      <generator>http://www.sixapart.com/movabletype/?v=4.31-en</generator>
      <docs>http://blogs.law.harvard.edu/tech/rss</docs> 

      
      <item>
	<enclosure url="http://blog.lib.umn.edu/froye001/filemaker/images/Picture%2018.png" length="158327" type="image/png" />
         <title>Updating Records With An Imported File</title>
         <description><![CDATA[<img alt="Picture 18.png" src="http://blog.lib.umn.edu/froye001/filemaker/images/Picture%2018.png" width="500" height="401" class="mt-image-none" style="" /><p>Be careful when you update records by way of an import. There is no undo so make sure you have a good backup. Here's how the two features work:</p>

<h3>Update Existing Records in Found Set</h3>
<p>Let's say you have ten records in your database. You just performed a search so now there are six records in your current found set. You have an import file that also contains six records. Under this option, the values in the imported records will replace the values in the existing records <strong>in position order</strong>. IOW, the first record in your import file will update the first record in your found set; the second record in your import file will update the second record in your found set; etc, etc, until you reach the end.</p>

<p>If you have more records in your import file than you do in your found set, use the checkbox "add remaining data as new records" to instruct the database whether to add or disregard them.</p>

<p>I would not recommend using this option unless you can be absolutely sure the order of the records in both found set and import file are identical. This is difficult to guarantee, what if your import file is sorted in a way you can't recall or recreate in your database?</p>

<h3>Update Matching Records in Found Set</h3>
This is the preferred method of updating records with an import. For this to work, your import file has a field with a unique identifier that corresponds to a field in your database with the same unique identifier. When you select this option you must map the ID fields then click again until the arrow is bi-directional. Under this method, the order of your records is irrelevant. The imported data will hunt down and update its matching record.</p>

<p>If you have records in your import file that do not have a match in your found set, use the checkbox "add remaining data as new records" to instruct the database whether to add or disregard them.</p>

<h3>Under Both Features</h3>
<ul>
	<li>Only the records in your found set will be effected by the import.</li>
	<li>Only the fields you map will be effected by the import.</li>
	<li>If a field in your found set contains a value while the imported field is empty, the resulting field will be empty.</li>
</ul>]]></description>
         <link>http://blog.lib.umn.edu/froye001/filemaker/2011/10/updating-records-with-an-impor.php</link>
         <guid>http://blog.lib.umn.edu/froye001/filemaker/2011/10/updating-records-with-an-impor.php</guid>
         <category>Tips and Tricks</category>
         <pubDate>Tue, 04 Oct 2011 09:56:37 -0600</pubDate>
      </item>
      
      <item>
	<enclosure url="http://blog.lib.umn.edu/froye001/filemaker/images/archive_02.jpg" length="43912" type="image/jpeg" /><enclosure url="http://blog.lib.umn.edu/froye001/filemaker/images/archive_03.jpg" length="41329" type="image/jpeg" /><enclosure url="http://blog.lib.umn.edu/froye001/filemaker/images/archive_04.jpg" length="47849" type="image/jpeg" /><enclosure url="http://blog.lib.umn.edu/froye001/filemaker/images/archive_05.jpg" length="41574" type="image/jpeg" /><enclosure url="http://blog.lib.umn.edu/froye001/filemaker/images/archive_06.jpg" length="41555" type="image/jpeg" /><enclosure url="http://blog.lib.umn.edu/froye001/filemaker/images/archive_07.jpg" length="29051" type="image/jpeg" /><enclosure url="http://blog.lib.umn.edu/froye001/filemaker/images/archive_08.jpg" length="42692" type="image/jpeg" /><enclosure url="http://blog.lib.umn.edu/froye001/filemaker/images/archive_11.jpg" length="45608" type="image/jpeg" />
         <title>How To Archive A Database</title>
         <description><![CDATA[<p>Read, "<a href="http://blog.lib.umn.edu/froye001/filemaker/2011/03/why-archive-databases.php">Why Archive Databases?</a>" to consider why you should archive obsolete databases. The following is my proposal for archiving files. Use the comment section to weigh in.</p>

<h3>While the file Is still hosted by FileMaker Server, open it as a guest and select File > Manage > Security...</h3>
<ol>
	<li>Make sure there's an account assigned the [Full Access] privilege set that is authenticated via FileMaker. <br /><img alt="archive_03.jpg" src="http://blog.lib.umn.edu/froye001/filemaker/images/archive_03.jpg" width="500" height="343" class="mt-image-none" style="" /></li>

	<li>Create an account assigned the [Read-Only Access] privilege set that is authenticated via FileMaker. <br /><img alt="archive_05.jpg" src="http://blog.lib.umn.edu/froye001/filemaker/images/archive_05.jpg" width="500" height="343" class="mt-image-none" style="" /></li>

	<li>Create an account assigned the [Data Entry Only] privilege set that is authenticated via FileMaker. <br /><img alt="archive_06.jpg" src="http://blog.lib.umn.edu/froye001/filemaker/images/archive_06.jpg" width="500" height="343" class="mt-image-none" style="" /></li>

	<li>Remove all other accounts and make sure Guest is deselected. <br /><img alt="archive_04.jpg" src="http://blog.lib.umn.edu/froye001/filemaker/images/archive_04.jpg" width="500" height="334" class="mt-image-none" style="" /></li>

	<li>Turn off extended privileges for ODBC, PHP, IWP etc. Just fmapp on the three default privilege sets. <br /><img alt="archive_02.jpg" src="http://blog.lib.umn.edu/froye001/filemaker/images/archive_02.jpg" width="500" height="311" class="mt-image-none" style="" /></li>

	<li>Save your changes to Security settings and close the file.</li>
</ol>

<h3>On the computer running FileMaker Server...</h3>
<ol>
	<li>Launch FileMaker Server Admin Console and close the file. <br /><img alt="archive_07.jpg" src="http://blog.lib.umn.edu/froye001/filemaker/images/archive_07.jpg" width="500" height="142" class="mt-image-none" style="" /></li>

	<li>In the Finder, navigate to the folder where the file is stored in Library > FileMaker Server > Data > Databases. Move it to your archive location. <strong>Make sure the file is deleted from the Databases folder!</strong></li>
</ol>

<h3>On your computer...</h3>
<ol>
	<li>Navigate to the archive location and open the file with FileMaker Pro. Use the [Full Access] credentials you created above.</li>

	<li>In File > Sharing > FileMaker Network... turn off Network Sharing, set access to "No users" and deselect "Don't display in Open Remote File dialog. <br /><img alt="archive_08.jpg" src="http://blog.lib.umn.edu/froye001/filemaker/images/archive_08.jpg" width="500" height="323" class="mt-image-none" style="" /></li>

	<li>Optional. In File > Manage > External Data Sources... clean up file references.*<br /><img alt="archive_11.jpg" src="http://blog.lib.umn.edu/froye001/filemaker/images/archive_11.jpg" width="500" height="207" class="mt-image-none" style="" /></li>

	<li>Close the file and test the [Read-Only Access] and [Data Entry Only] accounts.</li>
</ol>

<h3>Wrap Up</h3>
<ol>
	<li>Place a README file in the archive location documenting archive date, data owners and timeline for destruction.</li>

	<li>Communicate with data owners. Let them know the file has been archived. Review the steps for accessing it if needed. Get their approval on a timeline for destruction.</li>
</ol>

<p class="hint">* This was an issue for us because files had been around for decades and referenced external files that no longer existed or were once at different IP addresses. Bad external file references translate into a spinning beach ball when opening the file.</p>
]]></description>
         <link>http://blog.lib.umn.edu/froye001/filemaker/2011/03/how-to-archive-a-database.php</link>
         <guid>http://blog.lib.umn.edu/froye001/filemaker/2011/03/how-to-archive-a-database.php</guid>
         <category>Best Practice</category>
         <pubDate>Thu, 31 Mar 2011 09:02:54 -0600</pubDate>
      </item>
      
      <item>
	
         <title>Why Archive Databases?</title>
         <description><![CDATA[So much of our energy goes into creating new databases, but what to do with the old? You don't want to trash it because it retains some value. 
<ul>
	<li>It may store records that were not imported into the new solution.</li>
	<li>You want to keep it as a safety net in the event something catastrophic goes wrong with the new solution.</li>
	<li>You're required to keep it in accordance with your organization's data retention policy.</li>
	<li>You want to preserve it as an artifact of how things used to be.</li>
	<li>You suspect you may need to cannibalize it for reports or techniques.</li>
</ul>

This article isn't about data retention or backup strategies. For that follow the University's <a href="http://www.policy.umn.edu/Policies/Operations/OPMisc/RECORDRETENTION_PROC01.html">policy for data retention</a> and <a href="http://www.oit.umn.edu/security/topics/data-deletion/">destruction</a> and <a href="http://help.filemaker.com/app/answers/detail/a_id/7464/~/creating-backups-with-filemaker-server">FileMaker's best practice guide for backups</a>. This article proposes how to take a database offline, yet keep it secure and accessible if you need it.

<h3>Why Take It Offline?</h3>
<p>Why take it offline if it's not doing harm and there's room on the server?</p>

<p><strong>It's Good For Your Users</strong> So long as it's accessible, there is potential to become entangled with active files. It may show up in the Open Remote dialog box or appear in users' Favorites or Recent lists. Other developers may link to it not knowing it's been replaced. Perhaps it's accessible through back doors like ODBC or IWP. In any case, a user could open it and either be alarmed at seeing old data or worse, start using it again.</p>

<p><strong>It's Good For Your Server</strong> Removing retired files reduces the load on your server and creates headspace for the great stuff you're about to create. Also, consider auxillary files and routines in place to support a surplus database. Are there Active Directory groups created solely to support it? Is it bloating your daily backups?</p>

<p><strong>It's Good For You</strong> As a developer and administrator, you should clear the decks of inactive files so you can focus on supporting vital ones. Archive the file now while you still recall the master password and the purpose the file served.</p>

<h3>Objectives</h3>
<p>Here's what we want to accomplish by archiving files.</p>
<ul>
	<li>Remove files from FileMaker Server so they cannot be accidentally accessed by users.</li>
	<li>Move them onto a volume that gets backed.</li>
	<li>Retain the security of the data, adhereing to the rules around <a href="http://privacy.ahc.umn.edu/pub_pri_info.html">private data</a>.</li>
	<li>Make sure you can open the file if needed.</li>
	<li>Schedule the file for destruction according to University policy.</li>
	<li>Make sure data owners understand the change.</li>
</ul>

<p>Next read, "<a href="http://blog.lib.umn.edu/froye001/filemaker/2011/03/how-to-archive-a-database.php">How To Archive A Database</a>."</p>]]></description>
         <link>http://blog.lib.umn.edu/froye001/filemaker/2011/03/why-archive-databases.php</link>
         <guid>http://blog.lib.umn.edu/froye001/filemaker/2011/03/why-archive-databases.php</guid>
         <category>Best Practice</category>
         <pubDate>Fri, 25 Mar 2011 13:51:46 -0600</pubDate>
      </item>
      
      <item>
	
         <title>Fun With Finds</title>
         <description><![CDATA[Here are several search strategies you might need. For the following examples, the basic search is:
<pre>
$nameFind =& $fm->newFindCommand('web_NameSearch');
--one of the chunks of code below--
$nameFindresult = $nameFind->execute();
</pre>

<h3>All names in table.</h3>
<table class="table-results">
<tr>
	<td>Jack</td>
	<td>Robb</td>
	<td>36</td>
</tr>
<tr>
	<td>Jacob</td>
	<td>Schmidt</td>
	<td>44</td>
</tr>
<tr>
	<td>James</td>
	<td>Lee</td>
	<td>37</td>
</tr>
<tr>
	<td>Jim</td>
	<td>Nelson</td>
	<td>36</td>
</tr>
<tr>
	<td>Rob</td>
	<td>Sanchez</td>
	<td>44</td>
</tr>
<tr>
	<td>Robert</td>
	<td>James</td>
	<td>50</td>
</tr>
<tr>
	<td>Robbin</td>
	<td>Williams</td>
	<td>49</td>
</tr>
</table>


<h3>Simple search</h3>
<pre>$nameFind->addFindCriterion('First', 'rob');</pre>
<table class="table-results">
<tr>
	<td>Rob</td>
	<td>Sanchez</td>
</tr>
<tr>
	<td>Robert</td>
	<td>James</td>
</tr>
<tr>
	<td>Robbin</td>
	<td>Williams</td>
</tr>
</table>


<h3>Exact matching</h3>
<pre>$nameFind->addFindCriterion('First', '=rob');</pre>
<table class="table-results">
<tr>
	<td>Rob</td>
	<td>Sanchez</td>
</tr>
</table class="table-results">


<h3>Change the context to OR</h3>
<pre>$nameFind->addFindCriterion('First', 'james');
$nameFind->addFindCriterion('Last', 'james');
$nameFind->setLogicalOperator(FILEMAKER_FIND_OR);
</pre>
<table class="table-results">
<tr>
	<td>James</td>
	<td>Lee</td>
</tr>
<tr>
	<td>Robert</td>
	<td>James</td>
</tr>
</table>


<h3>Use an operator</h3>
<pre>$nameFind->addFindCriterion('Age', '>=44');</pre>
<table class="table-results">
<tr>
	<td>Jacob</td>
	<td>Schmidt</td>
	<td>44</td>
</tr>
<tr>
	<td>Rob</td>
	<td>Sanchez</td>
	<td>44</td>
</tr>
<tr>
	<td>Robert</td>
	<td>James</td>
	<td>50</td>
</tr>
<tr>
	<td>Robbin</td>
	<td>Williams</td>
	<td>49</td>
</tr>
</table>]]></description>
         <link>http://blog.lib.umn.edu/froye001/filemaker/2011/03/fun-with-finds.php</link>
         <guid>http://blog.lib.umn.edu/froye001/filemaker/2011/03/fun-with-finds.php</guid>
         <category>Tips and Tricks</category>
         <pubDate>Tue, 22 Mar 2011 13:04:45 -0600</pubDate>
      </item>
      
      <item>
	
         <title>PHP Problem and Solution</title>
         <description><![CDATA[<p>We recently upgraded (or downgraded, I don't know which) the version of PHP running on our web server. As a result, all my in_array tests broke. I use in_array on new and edit pages. They're dormant when a user first lands on the page. They're invoked when the user submits the form and fails one of the validations on the response page. A failure kicks them back to the form where targeted messages indicate what they did wrong. Read <a href="http://blog.lib.umn.edu/froye001/filemaker/2010/01/validate-form-data.php">Error Trapping</a> for the full explanation of this technique.</p>

<p>PHP didn't like testing against an array that was not declared. This breaks:
<pre>
if(in_array("MissingFirstName", $problem))
</pre>

<p>This fixed it:</p>
<pre>
if(isset($problem) && in_array("MissingFirstName", $problem))</pre>]]></description>
         <link>http://blog.lib.umn.edu/froye001/filemaker/2011/01/php-problem-and-solution.php</link>
         <guid>http://blog.lib.umn.edu/froye001/filemaker/2011/01/php-problem-and-solution.php</guid>
         <category>Tips and Tricks</category>
         <pubDate>Fri, 14 Jan 2011 13:11:25 -0600</pubDate>
      </item>
      
      <item>
	
         <title>Send Email Using PHP</title>
         <description><![CDATA[<p>Here's how you can construct an email and send it from your PHP page rather than write a script to run in FileMaker. Some things to note:</p>

<ul>
	<li>Your web server must be configured to allow sending emails. Talk to your server admin about that.</li>
<li>$emailAddress can be a single email address or several email addresses separated by commas. </li>
	<li>From and Reply-To are not parameters but rather optional values tossed in the $headers parameter. CC and BCC go here as well. Here's <a href="http://www.htmlite.com/php029.php">a better example</a>.</li>
	<li>Create line breaks with \n.</li>
</ul>

<pre>
$to = $emailAddress;
$subject = "Ticket ".$record->getField('_kprt_Ticket').": ".$record->
getField('rt_Title');
$message = "Do not reply to this e-mail. Track your ticket online: \n";
$message = $message."https://gpssecure.umn.edu/support/ticket.php?id=".$record->
getField('_kprt_Ticket')."\n\n";
$message = $message."We received your support ticket.";
$headers = "From: gpstech@umn.edu\n";
$fifth = "gpstech@umn.edu";

mail( $to, $subject, $message, $headers, $fifth );
</pre>

<p class="hint">In our environment, the mail command will not work without a fifth parameter which is an email address. Unfortunately, this address gets a copy of every email sent using this routine. Plan accordingly.</p>]]></description>
         <link>http://blog.lib.umn.edu/froye001/filemaker/2011/01/send-email-using-php.php</link>
         <guid>http://blog.lib.umn.edu/froye001/filemaker/2011/01/send-email-using-php.php</guid>
         <category></category>
         <pubDate>Mon, 03 Jan 2011 12:52:37 -0600</pubDate>
      </item>
      
      <item>
	<enclosure url="http://blog.lib.umn.edu/froye001/filemaker/cwp/cluttered.jpg" length="48176" type="image/jpeg" /><enclosure url="http://blog.lib.umn.edu/froye001/filemaker/cwp/neat.jpg" length="50274" type="image/jpeg" />
         <title>Display Value Lists in Neat Columns</title>
         <description><![CDATA[<p>Do you have a long list of radio buttons or checkboxes to present to your users? If you separate items with a paragraph, the list maybe too long and narrow. If you leave them as an unbroken list, it's difficult to tell which label is associated with which checkbox. Sometimes the label slips onto the next line. It's messy. Neither meet standards for good usability. </p>

<p>Below is the code to turn this:</p>
<p><img alt="cluttered.jpg" src="http://blog.lib.umn.edu/froye001/filemaker/cwp/cluttered.jpg" width="497" height="228" class="mt-image-none" style="" /></p>

<p>Into this:</p>
<p><img alt="neat.jpg" src="http://blog.lib.umn.edu/froye001/filemaker/cwp/neat.jpg" width="483" height="339" class="mt-image-none" style="" /></p>

<pre>
&lt;p>
&lt;label>Type&lt;/label>
	&lt;div style="float: left; width:250px; padding-right: 20px;">
&lt;?php 
$typeRep = 0;
$item = 0;
$itemsInColumn = intval((count($typeValues) / 2));
foreach($typeValues as $value){ 
$item = $item + 1; $typeRep = $typeRep + 1;
if($item > $itemsInColumn) { $item = 1; 
?>
	&lt;/div>
	&lt;div style="float: left; width:250px; padding-right: 20px;">
&lt;?php } ?>
&lt;input name="type<?php echo $typeRep; ?>" type="checkbox" value="&lt;?php echo $value; ?>" 
id="&lt;?php echo $value; ?>">
&lt;label for="&lt;?php echo $value; ?>" class="radio-checkbox-label">
&nbsp;&lt;?php echo $value; ?>&lt;/label>&lt;br />
&lt;?php } ?>
	&lt;/div>
&lt;/p>
&lt;input name="typeRep" type="hidden" value="&lt;?php echo $typeRep; ?>"/>
&lt;br clear="all">
</pre>

<h3>How It Works</h3>
<p>You need a little knowledge of CSS and HTML to pull this off. My labels run long so I determined that two columns best fits my overall design. Also, the value list is dynamic. Users may add or remove values so I want it to grow and shrink in proportion.</p>

<p>Open the section with a div that floats to the left with a little padding on the right. This will contain the first chunk of values.</p>

<p>Before opening the foreach loop, set the variable $item to zero. In this two-column solution, calculate how many $itemsInColumn by taking the integer of the total number of items divided by two.</p>

<p>Open the foreach loop and increment the $item variable. Test whether it's time to start a new column: if($item > $itemsInColumn). If it is, reset the $item counter. Close the div and open a new one.</p>

<p>When the foreach loop is exhausted, close the div and clear the floats.</p>

<p>The code above includes techniques covered in other articles. Read, <a href="http://blog.lib.umn.edu/froye001/filemaker/2009/09/cwp-search-80.php">Custom Web Publishing: Add Elements to Search Form</a> to learn how to turn a FileMaker value list into an array. Read, <a href="http://blog.lib.umn.edu/froye001/filemaker/2010/03/php-working-with-checkboxes.php">Working with Checkboxes</a>, to understand the $typeRep variable. Read, <a href="http://blog.lib.umn.edu/froye001/filemaker/2009/09/cwp-access-10.php">Custom Web Publishing: Accessible Forms</a> to understand how &lt;label for... allows users with imprecise motor skills to click anywhere on the label text, not just the tiny radio or check box. </p>

<p class="hint">Odd list of values to use as an example? This is part of an actual solution that reports incidents in accordance with the <a href="http://en.wikipedia.org/wiki/Clery_Act">Clery Act</a>.</p>]]></description>
         <link>http://blog.lib.umn.edu/froye001/filemaker/2010/12/display-value-lists-in-neat-co.php</link>
         <guid>http://blog.lib.umn.edu/froye001/filemaker/2010/12/display-value-lists-in-neat-co.php</guid>
         <category></category>
         <pubDate>Wed, 15 Dec 2010 10:00:03 -0600</pubDate>
      </item>
      
      <item>
	<enclosure url="http://blog.lib.umn.edu/froye001/filemaker/cwp/batch_edit_01.jpg" length="15557" type="image/jpeg" /><enclosure url="http://blog.lib.umn.edu/froye001/filemaker/cwp/batch_edit_02.jpg" length="18036" type="image/jpeg" />
         <title>Batch Edits</title>
         <description><![CDATA[<div id="downloadlink"><a href="http://blog.lib.umn.edu/froye001/filemaker/cwp/batch_edits.zip">Download sample file!</a></div>

<p>
<img alt="batch_edit_02.jpg" src="http://blog.lib.umn.edu/froye001/filemaker/cwp/batch_edit_02.jpg" width="258" height="186" class="mt-image-right" style="float: right; margin: 0 0 20px 20px;" /></p>

<p>
Here's a solution for processing edits to multiple records with a single form submission. In our example, we have a list of fruit and the number in stock.</p>

<br clear="all" />
<p>Here's how it's displayed on the web.</p>

<img alt="batch_edit_01.jpg" src="http://blog.lib.umn.edu/froye001/filemaker/cwp/batch_edit_01.jpg" width="298" height="182" class="mt-image-left" style="float: left; margin: 0 20px 20px 0;" />

<br clear="all" />
<p>Let's take a look under the hood. Before dumping search results into a table, we zero out a counter labeled $rep. Then we increment the value of $rep with each loop.</p>

<pre> 
$rep = 0;
foreach ($records as $record) { 
$rep = $rep +1; 
$recid=$record->getRecordId();
</pre>

<p>We tack that counter on the end of the field name. Do the same for the recid but make it a hidden field.</p>

<pre>
&lt;td>&lt;input name="Inventory&lt;?php echo $rep ?>" type="text" size="5" 
value="&lt;?php echo $record->getField('Inventory'); ?>">
&lt;input name="recid&lt;?php echo $rep; ?>" type="hidden" value="&lt;?php echo $recid; ?>">
</pre>

<p>
The browser renders it like this:</p>
<pre>
&lt;tr>
	&lt;td>Apples&lt;/td>
	&lt;td>&lt;input name="Inventory1" type="text" size="5" value="3">
	&lt;input name="recid1" type="hidden" value="22">&lt;/td>

&lt;/tr>
&lt;tr>
	&lt;td>Oranges&lt;/td>
	&lt;td>&lt;input name="Inventory2" type="text" size="5" value="4">
	&lt;input name="recid2" type="hidden" value="23">&lt;/td>

&lt;/tr>
&lt;tr>
	&lt;td>Pears&lt;/td>
	&lt;td>&lt;input name="Inventory3" type="text" size="5" value="5">
	&lt;input name="recid3" type="hidden" value="24">&lt;/td>

&lt;/tr>
</pre>

<p>The last step is to report how many repetitions (or rows) there were.</p>
<pre>
&lt;input name="Rep" type="hidden" value="&lt;?php echo $rep; ?>">
</pre>
<hr>

<h3>Process The Form</h3>

<p>First, note how many repetitions there were on the preceding page.</p>
<pre>$Rep = $_POST['Rep'];</pre>

<p>Use that value to build a loop to gather the inventory values and store them in an array.</p>
<pre>
$Count = 0;
while ($Count <= $Rep) {
$Count = $Count + 1;
$Inventory [$Count] = $_POST['Inventory'.$Count];
$recid [$Count] = $_POST['recid'.$Count];
} 
</pre>

<p>Use it again to build a loop to write the new inventory values to the database.</p>
<pre>
$Count = 0;
while ($Count <= $Rep) {
$Count = $Count + 1;
$editFruit =& $fm->newEditCommand('web_FruitList', $recid [$Count]);
$editFruit->setField('Inventory', $Inventory [$Count]);
$editFruitresult = $editFruit->execute();
}
</pre>]]></description>
         <link>http://blog.lib.umn.edu/froye001/filemaker/2010/12/batch-edits.php</link>
         <guid>http://blog.lib.umn.edu/froye001/filemaker/2010/12/batch-edits.php</guid>
         <category></category>
         <pubDate>Thu, 02 Dec 2010 13:00:03 -0600</pubDate>
      </item>
      
      <item>
	
         <title>Furlough Days</title>
         <description><![CDATA[<p>I used a <a href="http://www.briandunning.com/cf/1008">very cool custom function</a> to calculate due dates that avoid weekends and holidays. I added our upcoming forlough days to the list of holidays to avoid them too. In my solution, the auto-enter value for the due timestamp is calculated like this:</p>

<pre>
Let([
startDate = rd_Creation;
numDays = Case (
crt_UrgencyShort = "Urgent"; 1;
crt_UrgencyShort = "High"; 2;
crt_UrgencyShort = "Medium"; 5;
crt_UrgencyShort = "Low"; 28;
crt_UrgencyShort = "Long"; 183;
0);
loopCount = 0;
holidayList = Global::gt_HolidayList;
allowWeekends = "";
direction = ""
];

calcEndDate ( startDate ; numDays ; loopCount ; holidayList ; allowWeekends ; 
direction ) & " " & Time ( Hour(rm_Creation) ; Minute(rm_Creation) ; 
Seconds(rm_Creation) )
)
</pre>

<p>Holiday list is defined in a global field as:</p>
<pre>
9/6/2010
11/25/2010
11/26/2010
12/24/2010
12/27/2010
12/28/2010
12/29/2010
12/30/2010
12/31/2010
1/17/2011
3/18/2011
5/30/2011
7/4/2011
</pre>]]></description>
         <link>http://blog.lib.umn.edu/froye001/filemaker/2010/09/furlough-days.php</link>
         <guid>http://blog.lib.umn.edu/froye001/filemaker/2010/09/furlough-days.php</guid>
         <category>Tips and Tricks</category>
         <pubDate>Fri, 24 Sep 2010 14:56:58 -0600</pubDate>
      </item>
      
      <item>
	<enclosure url="http://blog.lib.umn.edu/froye001/filemaker/assets_c/2010/08/saveday_01-thumb-500x195-52458.jpg" length="52423" type="image/jpeg" /><enclosure url="http://blog.lib.umn.edu/froye001/filemaker/assets_c/2010/08/saveday_02-thumb-500x450-52459.jpg" length="69277" type="image/jpeg" /><enclosure url="http://blog.lib.umn.edu/froye001/filemaker/assets_c/2010/08/saveday_03-thumb-500x238-52460.jpg" length="44797" type="image/jpeg" />
         <title>FileMaker Saves The Day</title>
         <description><![CDATA[<p class="hint">FileMaker played a pivotal role in a recent web clean-up project. It's more than a database, it's a powerful data scrubbing tool.</p>

<h3>The Problem</h3>
<ul>
<li>We have a sprawling web property with ~26,000 items, ~3,000 of which are unique html files. We don't know what all we have or who "owns" it.</li>

<li>For years the site was managed in Dreamweaver and Contribute and as a result, the code is loaded with in-line styling like this:<pre style="display:inline;"> &lt;p align="center" class="style1" style="margin-top: 0; margin-bottom: 0"&gt;</pre> In-line styles prevent us from extending content to other areas like print or mobile.</li>

<li>The code is not semantic. There are no heading tags, tables are used to position elements, and blockquotes are used to indent text. As a result, our site does not meet accessibility requirements. It may look okay on the web, but if you rely on a screen reader our site is one, long, run-on sentence.</li>
</ul>

<h3>The Objective</h3>
<ul>
<li><strong>Audit</strong>. Make an accounting of all content. Assign owners. Determine whether content should be updated or removed.</li>

<li><strong>Scrub it</strong>. Remove all in-line styling.</li>

<li><strong>Mark it up</strong>. Apply proper tags.</li>

<li><strong>Edit it</strong>. Have content providers (which is every member of our department) edit their content according to a style guide prepared by the Communications Team.</li>
</ul>

<h3>Step 1: Learn How To Do It Right</h3>
<p>At the University, there's no excuse for not knowing how to do things correctly. The <a href="http://uttc.umn.edu/training/">UTTC</a> offers several web training courses <strong>free</strong> to staff and students. I recommend the following:</p>

<ul>
	<li><a href="http://uttc.umn.edu/training/courses/description/?designator=DSIGN111">Web Accessibility Issues and Techniques</a></li>
	<li><a href="http://uttc.umn.edu/training/courses/description/?designator=HTML101">Web Development: Essentials - XHTML</a></li>
	<li><a href="http://uttc.umn.edu/training/courses/description/?designator=CSS101">Web Development: Essentials - Cascading Style Sheets</a></li>
	<li><a href="http://uttc.umn.edu/training/courses/description/?designator=WDU201">Web Development: University Template Fundamentals</a></li>
	<li><a href="http://uttc.umn.edu/training/courses/description/index.jsp?designator=WDU101">Web Development: Working Effectively in the University Environment</a></li>
</ul>

<h3>Step 2: Get a List of Your Site Structure</h3>
<p>Create a "site" in Dreamweaver where the local folder is a new one you create for this purpose and the remote folder is your live site. Make a connection and "GET" your entire site. For large sites, this may take a while. When you're done you have a local copy of your live site.</p>

<p>Use the default settings in <a href="http://www.searchwaresolutions.com/">Print Window</a> to walk through the folder hierarchy and output a text file with every item listed line by line. </p>

<h3>Step 3: Import It Into FileMaker</h3>
<p><a href="http://blog.lib.umn.edu/froye001/filemaker/docs/WebCleaner.zip">Download WebCleaner</a>, a FileMaker database I created. Import the text file, mapping only the file name and file type into the rt_FileNameImport and rt_FileTypeImport fields. Click the button to "Backfill File Path" and "Construct Full URL."</p>

<p>Delete records you don't need. I deleted all folders, all image files, pdfs, movies, etc. &#151; basically anything that was not a complete page with content.</p>

<h3>Step 4: Scrub It In FileMaker</h3>
<p>You'll need the <a href="http://www.360works.com/regular-expressions-plugin/">360Works Patterns</a> plug-in to perform a search and replace using regular expression. Many thanks to <a href="http://www.consking.com/article/sanitizing-html-with-textmate-using-regular-expressions">this site</a> for helping me with regular expression. Here's what the database will do for you:</p>
<ul>
	<li>Use the complete URL to screen-scrape raw html from the live page.</li>
	<li>Calculate the portion that is main content, ignoring header, nav bar and footer.</li>
	<li>Strip inline styles. This step requires the plug-in. Edit the script to to clean as much or as little as you want.</li>
	<li>Perform another screen-scrape, this time pulling just text from the main content area in order to calculate a word count.</li>
	<li>Validate against a list of common misspellings and awkward phrases.</li>
	<li>Help you assign owners, audience and action for each page.</li>
	<li>Flag complex pages &#151; those with tables, javascript, internal navigation, images and blockquotes.</li>
</ul>

<h3>Step 5: Publish It With FileMaker</h3>
<p>Now we get content owners involved. I built a <a href="http://blog.lib.umn.edu/froye001/filemaker/docs/audit.zip">custom web site</a> using FileMaker's API for PHP. It sits behind the Central Authentication Hub so I can display a list of assigned pages based on the user's log-in.</p>

<p><a href="http://blog.lib.umn.edu/froye001/filemaker/assets_c/2010/08/saveday_01-52458.php" onclick="window.open('http://blog.lib.umn.edu/froye001/filemaker/assets_c/2010/08/saveday_01-52458.php','popup','width=978,height=382,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://blog.lib.umn.edu/froye001/filemaker/assets_c/2010/08/saveday_01-thumb-500x195-52458.jpg" width="500" height="195" alt="saveday_01.jpg" class="mt-image-none" style="border: solid 1px #999;" /></a></p>

<p><a href="http://blog.lib.umn.edu/froye001/filemaker/assets_c/2010/08/saveday_02-52459.php" onclick="window.open('http://blog.lib.umn.edu/froye001/filemaker/assets_c/2010/08/saveday_02-52459.php','popup','width=991,height=893,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://blog.lib.umn.edu/froye001/filemaker/assets_c/2010/08/saveday_02-thumb-500x450-52459.jpg" width="500" height="450" alt="saveday_02.jpg" class="mt-image-none" style="border: solid 1px #999;" /></a></p>

<p>We asked content owners to edit content and apply tags. We trained them how to tag properly and gave them a limited tool bar to work with. The tool bar is courtesy of <a href="http://ckeditor.com/">CKEditor</a>.</p>

<p><a href="http://blog.lib.umn.edu/froye001/filemaker/assets_c/2010/08/saveday_03-52460.php" onclick="window.open('http://blog.lib.umn.edu/froye001/filemaker/assets_c/2010/08/saveday_03-52460.php','popup','width=990,height=473,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://blog.lib.umn.edu/froye001/filemaker/assets_c/2010/08/saveday_03-thumb-500x238-52460.jpg" width="500" height="238" alt="saveday_03.jpg" class="mt-image-none" style="border: solid 1px #999;" /></a></p>

<h3>Conclusion</h3>
<p>Now we have clean content in a searchable database. Our next step is to move to a content management system, probably Drupal.</p>]]></description>
         <link>http://blog.lib.umn.edu/froye001/filemaker/2010/08/filemaker-saves-the-day.php</link>
         <guid>http://blog.lib.umn.edu/froye001/filemaker/2010/08/filemaker-saves-the-day.php</guid>
         <category>Tips and Tricks</category>
         <pubDate>Thu, 12 Aug 2010 21:21:43 -0600</pubDate>
      </item>
      
      <item>
	
         <title>Food for Thought</title>
         <description><![CDATA[<p>The need to share or piggyback one another's resources has come up in the context of licensing and hosting space. Why should several units buy a few licenses when we can pool our needs and get a volume discount? We have support from FileMaker to do this but no apparatus here to coordinate it. </p>

<p>Not every unit has their own server, the money to buy one, the technical staff to administer it or permission from OIT to put it on the network. Third party hosting companies are available but what are the implications for private and FERPA data? If you have a small solution to deploy, either it's cost prohibitive or technically impossible.</p>

<p>Our FileMaker User Group is newly formed and still defining ourselves and our mission. Perhaps solving for shared licensing and hosting services is part of that mission. We can boast the benefits of FileMaker all day long but if units don't have an affordable entry point it's not a viable option.</p>

<p>Discuss.</p>]]></description>
         <link>http://blog.lib.umn.edu/froye001/filemaker/2010/04/food-for-thought.php</link>
         <guid>http://blog.lib.umn.edu/froye001/filemaker/2010/04/food-for-thought.php</guid>
         <category></category>
         <pubDate>Tue, 06 Apr 2010 07:55:37 -0600</pubDate>
      </item>
      
      <item>
	
         <title>Re-Using Code</title>
         <description><![CDATA[<div id="downloadlink"><a href="http://blog.lib.umn.edu/froye001/filemaker/cwp/reuse_code.zip">Download sample file!</a></div>
<p>In short order you discover you're writing the same code from one page to another and you begin exploring strategies for re-using code. PHP provides a great mechanism for this through the <a href="http://php.net/manual/en/function.include.php">include</a> function. The benefit of re-using code is you can make one change and it ripples throughout your solution. The downside is it adds a layer of abstraction that makes trouble-shooting more difficult. The trick is knowing what code to put in your include file and what code to write locally. </p>

<p>Download the file above to see the code and file structure for a very basic solution.</p>]]></description>
         <link>http://blog.lib.umn.edu/froye001/filemaker/2010/03/re-using-code.php</link>
         <guid>http://blog.lib.umn.edu/froye001/filemaker/2010/03/re-using-code.php</guid>
         <category></category>
         <pubDate>Mon, 29 Mar 2010 13:09:25 -0600</pubDate>
      </item>
      
      <item>
	
         <title>Live Blogging FileMaker Product Briefing</title>
         <description><![CDATA[<p>Notes from <a href="http://blog.lib.umn.edu/froye001/filemaker/2010/03/save-the-date.php">March 10 Product Briefing</a>. FileMaker 11 debuted Monday! This group is mostly running versions 7 and up but many are still running 5 and 6. </p>

<h3>Charting!</h3>
<p>FileMaker bought and embedded into FileMaker. More charts will be added in subsequent versions. Assign x and y axis to fields. Oooo, nice color palettes! The chart is live depending on your found set. You can even chart summary field values based on a break field. All you do is sort, the same as if you were preparing a table.</p>

<h3>Filtering</h3>
<p>Can filter based on a field value or a calculation. You don't need extra indexing. Basically, you can use one relationship to show many different data sets. This is really going to streamline the relationship graph. Go To Related Record script step will not consider filters.</p>

<h3>Variables at the UI Level</h3>
<p>Nice! Now you don't have to create a field in order to show it on the layout. Something I've wanted in FM since I worked in FoxPro in the early 90s. Bill just showed a cool technique that combines portal filtering, charts and script triggers. Essentially, the chart's X and Y are set to variables. A script trigger walks through the portal and builds the value.</p>

<h3>Layout Groups</h3>
<p>Another tool just for developers. But there's more, you can do lots more in the Manage Layouts dialog - including set script triggers and go to the layout. Also new in layout mode are badges that mark field that have script triggers, conditional formatting, etc. Do we need stinkin' badges?</p>

<h3>Googly Experience</h3>
<p>A handsome, google-like find window is now up in the status bar. It will conduct a search on all of the fields on the current layout. And what's more...</p>
<ul>
	<li>You can turn off Quick Find on a layout</li>
	<li>You can disable a field from being searched by the Quick Find</li>
	<li>You can also hijack Quick Find and tie it to a script</li>
</ul>

<h3>Good Stuff</h3>
<ul>
	<li>You can import Custom Functions.</li>
	<li>Can use variables in Perform Find</li>
	<li>Nice trick where you build a complex query that progressively thins the record set </li>
	<li>Now there's an Inspector</li>
	<li>Security - can better manage who can pull a table occurrence</li>
	<li>Snapshot Links are pretty cool, an easy way to send a found set to another user with access to the file while preserving the layout, sort order, current record, etc.</li>
</ul>

<h3>Ad Hoc Reporting</h3>
<p>FileMaker's been turning over more tools to the user for searching and reporting. As a developer, you can give users a view only layout and let them "go to town" because the user can:</p>
<ul>
	<li>Save finds</li>
	<li>Sort and subtotal in browse mode</li>
	<li>Control what fields are on a layout</li>
</ul>

<h3>Server</h3>
<ul>
<li>Continued performance improvements especially when FileMaker is an ODBC source.</li>
<li>Can make clones as part of your backup routine</li>
<li>Statistics tab logs lots of stuff which helps in trouble-shooting</li>
<li>Can turn over a folder to a group for management</li>
</ul>

<h3>Upgrade!</h3>
<p>Get yourself into 10 at the very least. If you host your solution on version 11, client versions 7, 8, 9, 10 and 11 can connect. If you host your solution on version 7, client versions 7-11 can connect but not take advantage of any functionality in a version higher than the server. If you're running clients earlier than version 9, read this caveat from a FileMaker staffer on the Technet Forum:</p>

<blockquote style="color:#666; line-height:140%;">FileMaker Pro 9, 10 and 11 clients are the only clients "supported" to work with FileMaker Server 11.  However, FileMaker 7, 8, and 8.5 clients are not blocked from connecting to FileMaker Server 11 BUT you are "swimming without a lifeguard" if you choose to do so.  Probably won't have an issue, inasmuch as you would have doing similar things with Server 10 - but [FileMaker]Technical Support will more than likely tell you that isn't a support configuration if you call in with issues.</blockquote>

<h3>More 11 Coverage</h3>
<p>List member Marc found a page someone put together of all of the release-day coverage of the FileMaker 11 release on various blogs, including videos, technique files, etc.
<a href="http://fmprandom.blogspot.com/2010/03/listing-of-announcement-day-filemaker.html">http://fmprandom.blogspot.com/2010/03/listing-of-announcement-day-filemaker.html</a>. Thanks Marc!</p>

<p>For a complete list of new features in version 11, read this "<a href="http://blog.lib.umn.edu/froye001/filemaker/images/FileMaker11.pdf">What's New</a>" list from the FM11 help files. Thanks Elleni!</p>]]></description>
         <link>http://blog.lib.umn.edu/froye001/filemaker/2010/03/product-briefing.php</link>
         <guid>http://blog.lib.umn.edu/froye001/filemaker/2010/03/product-briefing.php</guid>
         <category>Notes</category>
         <pubDate>Wed, 10 Mar 2010 11:36:08 -0600</pubDate>
      </item>
      
      <item>
	
         <title>UMN FileMaker Product Briefing</title>
         <description><![CDATA[<p>Wednesday, March 10, 2010<br />
11:30 am - 1:30 pm<br />
Mechanical Engineering, Room 108 [ <a href="http://campusmaps.umn.edu/tc/map.php?xmin=481386.1768238284&ymin=4980083.237887078&xmax=481862.11677617155&ymax=4980414.066912922">map</a> ]</p>

<p>
Our favorite FileMaker duo, Bill Kaiser and Bill Heizer, are coming to town. They've offered to come to campus and talk FileMaker with us.</p>

<p><a href="http://spreadsheets.google.com/viewform?formkey=dGlyMHgtY1RSaHVQZndvUFBhNHpzamc6MA">Register</a> by noon Monday.</p>]]></description>
         <link>http://blog.lib.umn.edu/froye001/filemaker/2010/03/save-the-date.php</link>
         <guid>http://blog.lib.umn.edu/froye001/filemaker/2010/03/save-the-date.php</guid>
         <category>Events</category>
         <pubDate>Wed, 10 Mar 2010 09:38:51 -0600</pubDate>
      </item>
      
      <item>
	<enclosure url="http://blog.lib.umn.edu/froye001/filemaker/cwp/checkbox01.jpg" length="31269" type="image/jpeg" />
         <title>Working with Checkboxes</title>
         <description><![CDATA[<p>Checkboxes are a great way to store more than one value in a single field. FileMaker makes it easy to format fields as checkboxes &#151; select the field, invoke the Field/Control Setup dialog box, select the display style and associate a value list. The user sees clickable checkboxes but FileMaker is actually storing the values as a paragraph-separated list.</p>
<img alt="checkbox01.jpg" src="http://blog.lib.umn.edu/froye001/filemaker/cwp/checkbox01.jpg" width="498" height="215" class="mt-image-none" style="" />

<p>It's not as easy to work with checkboxes on the web because you need to assemble the values three different ways depending on what you're trying to achieve:</p>
<ul>
	<li>a paragraph-separated stack for saving to FileMaker</li>
	<li>a comma-separated string to display nicely on a page</li>
	<li>an array to show as editable checkboxes</li>
</ul>

<h3>From FileMaker to Display Page</h3>
<p>Here's how to take a paragraph-separated list from the database and display it as a comma-separated list on the web. First, set the field value to a variable.</p>
<pre>
$coreStack = $record->getField('rt_CoreRequirement'); 
</pre>

<p>Next, convert the paragraph-separated stack to a comma separated string using <a href="http://php.net/manual/en/function.str-replace.php">str_replace</a>.
<pre>
$coreString = str_replace ("\n", ", ", $coreStack );
</pre>

<p>Display on your page with echo.</p>
<pre>
echo $coreString //displays "Historical Perspectives, Mathematical Thinking"
</pre>

<h3>From FileMaker to Editable Checkboxes</h3>
<p>Here's how to take a paragraph-separated list from the database and display it as checkboxes that the user can edit. Just like above, set the field value to a variable.</p>
<pre>
$coreStack = $record->getField('rt_CoreRequirement'); 
</pre>

<p>Next, convert the paragraph-separated stack to an array using <a href="http://php.net/manual/en/function.explode.php">explode</a>.
<pre>
$coreArray = explode("\n", $coreStack);
</pre>

<p>Now, use the array to test each value in the value list. In this example, the value list for core requirements was called at the top of the page using these two lines:</p>
<pre>
$layout =& $fm->getLayout('web_CourseEdit');
$coreValues = $layout->getValueListTwoFields('CoreList');
</pre>

<p>Here's the chunk of code followed by what the browser renders, followed by what it looks like on screen. Then we'll break it down.</p>
<pre>
&lt;label>Core Requirements&lt;/label>&lt;br />
&lt;?php 
$coreRep = 0; 
foreach($coreValues as $value){ 
$coreRep = $coreRep + 1; ?>
&lt;input name="core&lt;?php echo $coreRep; ?>" type="checkbox" 
value="&lt;?php echo $value; ?>" id="&lt;?php echo $value; ?>" 
&lt;?php if(in_array($value, $coreArray)) { echo "CHECKED"; }?>>
&lt;label for="&lt;?php echo $value; ?>">&lt;?php echo $value; ?>&lt;/label>&lt;br />
&lt;?php } ?>
&lt;input name="coreRep" type="hidden" value="&lt;?php echo $coreRep; ?>"/>
</pre>

<p class="hint">
&lt;label>Core Requirements</label>&lt;br /><br />
&lt;input name="core1" type="checkbox" value="Biological Science with Lab" id="Biological Science with Lab" >&lt;label for="Biological Science with Lab">Biological Science with Lab&lt;/label>&lt;br /><br />
&lt;input name="core2" type="checkbox" value="Physical Science with Lab" id="Physical Science with Lab" >&lt;label for="Physical Science with Lab">Physical Science with Lab&lt;/label>&lt;br /><br />
&lt;input name="core3" type="checkbox" value="Historical Perspectives" id="Historical Perspectives" CHECKED>&lt;label for="Historical Perspectives">Historical Perspectives&lt;/label>&lt;br /><br />
&lt;input name="core4" type="checkbox" value="Social Sciences" id="Social Sciences" >&lt;label for="Social Sciences">Social Sciences&lt;/label>&lt;br /><br />
&lt;input name="core5" type="checkbox" value="Literature" id="Literature" >&lt;label for="Literature">Literature&lt;/label>&lt;br /><br />
&lt;input name="core6" type="checkbox" value="Arts/Humanities" id="Arts/Humanities" >&lt;label for="Arts/Humanities">Arts/Humanities&lt;/label>&lt;br /><br />
&lt;input name="core7" type="checkbox" value="Mathematical Thinking" id="Mathematical Thinking" CHECKED>&lt;label for="Mathematical Thinking">Mathematical Thinking&lt;/label>&lt;br /><br />
&lt;input name="coreRep" type="hidden" value="7"/>
</p>

<p class="hint">
<label>Core Requirements</label><br />
<input name="core1" type="checkbox" value="Biological Science with Lab" id="Biological Science with Lab" ><label for="Biological Science with Lab">Biological Science with Lab</label><br />
<input name="core2" type="checkbox" value="Physical Science with Lab" id="Physical Science with Lab" ><label for="Physical Science with Lab">Physical Science with Lab</label><br />
<input name="core3" type="checkbox" value="Historical Perspectives" id="Historical Perspectives" CHECKED><label for="Historical Perspectives">Historical Perspectives</label><br />
<input name="core4" type="checkbox" value="Social Sciences" id="Social Sciences" ><label for="Social Sciences">Social Sciences</label><br />
<input name="core5" type="checkbox" value="Literature" id="Literature" ><label for="Literature">Literature</label><br />
<input name="core6" type="checkbox" value="Arts/Humanities" id="Arts/Humanities" ><label for="Arts/Humanities">Arts/Humanities</label><br />
<input name="core7" type="checkbox" value="Mathematical Thinking" id="Mathematical Thinking" CHECKED><label for="Mathematical Thinking">Mathematical Thinking</label><br />
<input name="coreRep" type="hidden" value="7"/>
</p>

<p>These lines create a counter for each value in the value list.</p>
<pre>$coreRep = 0; ...
$coreRep = $coreRep + 1;</pre>

<p>The counter is used to serialize the input field for each checkbox. This will help us process the data on the response page.</p>
<pre>&lt;input name="core&lt;?php echo $coreRep; ?>" type="checkbox" ...</pre>

<p>To determine whether the box is checked, use <a href="http://php.net/manual/en/function.in-array.php">in_array</a>. It tests whether the needle ($value) is in the haystack ($coreArray).</p>
<pre>...&lt;?php if(in_array($value, $coreArray)) { echo "CHECKED"; }?>></pre>

<p>Finally, tell the response page how many input fields to process.</p>
<pre>&lt;input name="coreRep" type="hidden" value="&lt;?php echo $coreRep; ?>"/>
</pre>

<p class="hint">For more on radio buttons, checkboxes and drop-down lists, read, "<a href="http://blog.lib.umn.edu/froye001/filemaker/2009/09/cwp-search-80.php">Custom Web Publishing: Add Elements to Search Form</a>." To understand how ids and labels work, read, "<a href="http://blog.lib.umn.edu/froye001/filemaker/2009/09/cwp-access-10.php">Custom Web Publishing: Accessible Forms</a>."</p>

<h3>From Editable Checkboxes to FileMaker</h3>
<p>On the response page, build an array of each value the user CHECKED using <a href="http://php.net/manual/en/control-structures.while.php">while</a>.</p>
<pre>
$coreRep = $_POST['coreRep'];
$coreCount = 0;
while ($coreCount <= $coreRep) {
$coreCount = $coreCount + 1;
if(!empty($_POST['core'.$coreCount])) { 
$coreArray [] = $_POST['core'.$coreCount]; 
}}
</pre>

<p>Now turn the array into a paragraph-separated stack using <a href="http://us3.php.net/manual/en/function.implode.php">implode</a>.</p>
<pre>$coreStack = implode("\r", $coreArray); 
</pre>

<p>And that, my friends, is what you save to the database.</p>
<pre>
$editCourse->setField('rt_CoreRequirement', $coreStack);</pre>]]></description>
         <link>http://blog.lib.umn.edu/froye001/filemaker/2010/03/php-working-with-checkboxes.php</link>
         <guid>http://blog.lib.umn.edu/froye001/filemaker/2010/03/php-working-with-checkboxes.php</guid>
         <category></category>
         <pubDate>Mon, 01 Mar 2010 13:22:31 -0600</pubDate>
      </item>
      
   </channel>
</rss>
