Custom PHP-Generated Downloadable Files

Today I am going to talk about how to create a downloadable file using PHP. There are several instances where you might want to create a downloadable file. The very first downloadable file I created was a custom CSV (Comma Separated File). Using PHP, I pulled information from a database and formatted it in the CSV format.

The Problem with Generic Models

Upon further reflection of the generic Attribute Models I discussed, I started to realize that there may be a problem with business logic. Many of the attribute types I listed will use very basic and universal logic. A text field will always be a text field, will be displayed as a text field, and will act as a text field. But there are a couple of cases to consider.

Facebook Research

The first task of this project is to research the three main sites which provide the base objective against which the site will be tested: Facebook.com and MySpace.com. As I was most familiar with Facebook.com, I figured I would start there.

FileMaker PositionValue() Custom Function

It seems only logical to me that if they have a Position() function for text, that they would have a PositionValue() function for value lists. However, since that is not the case, I have written my own.

FileMaker AppendValue() Custom Function

Yet another useful function that was omitted from the FileMaker Scripting Engine. This function appends the string specified by value on to the listOfValues only if it is not already present.

ExcludeValues() Custom Function version 2

This function is basically the opposite of the built-in FilterValues() function--instead of finding the intersection between the two passed value lists, this function will find the difference (textToExclude - excludeVals instead of textToExclude ∩ excludeVals).

Syndicate content