|
ColdFusion
Forms
| |
ColdFusion can create its own forms with the CFFORM tag. The "normal" controls have capabilities beyond what the HTML versions provide. For example, the CFTEXTINPUT tag is similar to the HTML INPUT=text tag, but with CFTEXTINPUT you can also specify font and alignment options. CFFORM has the added advantage that you don't have to juggle CFOUTPUT tags and HTML FORM tags to reference ColdFusion variables in your forms
CFFORM offers some unique and powerful Java applet-based controls. CFTREE lets you display hierarchical information in a space-saving collapsible tree populated from data source queries. CFSLIDER defines a slider control. CFGRID creates a data grid you can populate from a query or by defining the contents of individual cells. Grids can also be used to insert, update, and delete records from a data source.
|
Custom tags
| |
There are two types of custom tags: those developed using the ColdFusion language and those developed using an external programming language such as Visual C++ (the latter are generally known as CFX tags).
Creation of a custom tag is basically a way of encapsulating some functionality in a "black box." You can easily build your own custom tags with ColdFusion, or you can obtain custom tags from third party sources.
|
Variables and defaults
| |
Using CFPARAM without the DEFAULT attribute is a handy way to clearly define the variables that a page or a custom tag expects to receive before processing can proceed. If the variable does not exist, the ColdFusion server stops processing the page.
CFPARAM with the DEFAULT attribute tests for the variable and if it doesn’t exist, creates it with the value supplied as default. Alternately, the IsDefined function can be used in a conditional statement.
|
ASP
ASP provides some unique control over query results. Details are in the
"Accessing a Database" section.
PHP
Image Generation and Manipulation
| |
Image support is available in PHP provided that it is built and installed with the right libraries available in the right places. Consult a good book on PHP for details.
You can code the name of a php script in place of the name of an image
in an HTML image tag, e.g.
<IMG SRC="ImageGeneratingScript.php">.
The script can generate the image on the fly and stream it directly
to the browser.
When installed with the GD Library, PHP’s API provides functions to
- Create, delete, resize and modify images
- Draw basic geometric figures
- Manipulate text and fonts
- Manipulate colors
- Interlace and manipulate pixels
- Handle PostScript files
Although most applications will have no requirement for most of this, one very handy function is GetImageSize. If you need create HTML image tags on the fly and want to include accurate HEIGHT and WIDTH attributes, this function will return the information you want for any GIF, JPEG or PNG image file.
You can set up a form with an INPUT type = IMAGE to trigger submission of the form to a PHP program. Two variables representing the x and y coordinates of the mouse click on the image will be sent with the form. The receiving PHP script can then compare those x and y values to the known coordinates of relevant "hot" spots on the image.
|
Classes and Objects
| |
PHP allows you to build classes with properties and methods similar to other OOP languages. Aside from the benefits this offers to your coding style, it provides the advantage of conveniently encapsulated pieces of functional code that you can obtain from outside sources and thereby easily solve some complex programming problems.
|
|