Matchcode

 

Example Name:

 

postcode_lookup

Language:

 

PHP

API type:

 

PHP

API component filename (Linux):

 

php5_matchcode_client.so

API component filename (Windows):

 

php5_matchcode_client.dll

Environment:

 

PHP 5.1 / PHP 5.3

 

What does it do?

 

Looks up an address using postcode as input and displays a list of addresses to choose from.

 

This example is designed to work with UK PAF files.

 

 

Could be used as a starting point for:

 

Creating a web site to capture a UK address with minimum user input.

 

 

Where to find the example code:

 

After running the setup from the Matchcode CD to install the client APIs you will find these examples installed (by default) in:

 

Windows:

C:\Program Files\Capscan\SDK\Matchcode Client API\PHP\Examples\postcode_lookup

 

Linux:

/opt/capscan/mcd5cs/PHP/Examples/postcode_lookup

 

If you have installed to another location you will need to change the path where necessary.

 

 

What each file does:

 

File name

 

What does it do?

index.htm

HTML entry point for the example

postcode_lookup.php

PHP address lookup code. Returns JSON output.

postcode_lookup.js

JavaScript code for sending search to postcode_lookup.php and displaying results.

spider.ini

Matchcode client settings. Used to set IP address of the Matchcode server.

postcode_lookup.css

CSS stylesheet for the example

capscan.css

CSS stylesheet for the example

 

 

 

Preparing to run the example:

 

For Windows installations please ensure that you have selected the appropriate extension for your version of PHP. More information can be found in the PHP\readme.txt file.

Please make sure that you have installed the PHP client extension and Capscan Pool Manager is up and running.

 

 

Running the example:

 

1.     Copy example files to the web server

 

2.     Show index.htm with a web browser

 

 

Trouble-shooting and hints:

 

1.     Create a php file containing “<?php phpinfo(); ?>”. View file using a web browser and check “matchcode_client” is listed as an extension.

 

2.     Check the Host setting of spider.ini. Make sure it points to the machine running Capscan Pool Manager.

 

3.     If you are running on a LAN make sure that the Capscan Pool Manager is running correctly.  To do this you can use the PoolMan Admin application that is installed along with the Capscan Pool Manager.

 

4.     If you are using a firewall make sure that it is not blocking this example or the Capscan Pool Manager.  By default the Capscan Client/Server uses port 27920 for sending and receiving data.

 

5.     Try installing and running the Matchcode DC application to test that the Capscan Pool Manger is working correctly.  The installation for Matchcode DC can be found on the CD under:

 

Win32\mcd526.

 

6.     Check that the pool you are trying to connect to is named “PAF”. If it is not, then you will need to update “$pool” in postcode_lookup.php appropriately

 

7.     For more hints and tips please see the Matchcode Client API guide.