Using the <CF_CountryHawk> Custom Tag

CountryHawk integrates seamlessly with Macromedia ColdFusion and ColdFusion MX. To use the CountryHawk component from ColdFusion pages you can either create an instance of the COM object yourself, or use the <CF_CountryHawk> custom tag, which many ColdFusion developers will find more convenient.

Note: You must be running ColdFusion or ColdFusion MX to use this tag. If you are running another programming language, such as ASP or ASP.NET, you can skip this section.

In order for the custom tag and ColdFusion samples to be installed, you must install the ActiveX/COM version of CountryHawk at a minimum. This option is selected by default. If you disabled this option previously you can rerun the installation and choose the ColdFusion Support feature to add the tag and samples.

To have ColdFusion recognize the custom tag, copy the CountryHawk.cfm file from your \Program Files\cyScape\CountryHawk\samples\ColdFusion directory to your \CFusion\CustomTags directory or the directory which contains the CFM pages that will use the custom tag.

Once the tag is installed, you can use it simply by referencing <CF_CountryHawk> from your CFM scripts. For example:

 <CF_CountryHawk>

 <CFOUTPUT>

  Your country code is: #CountryHawk.CountryCode()#<br>

  Your country name is: #CountryHawk.CountryName()#<br>

  Your IP address is: #CountryHawk.IPAddr#<br>

 </CFOUTPUT>

Tip: View the contents of the CountryHawk.cfm custom tag file for more detailed information on using this tag and its optional features.

Tip: See the ch_basics.cfm and ch_initialize.cfm samples that demonstrate various ways to use the custom tag and CountryHawk's properties and methods with ColdFusion.

See Also:

Using the CountryHawk component

Defining Regions

Installation options

About the sample scripts