PHP Ink Finder

This script was written for Setch for use on Cartridge City's web site. He needed a way to allow users to locate the correct cartridges for their printer without the need for MySQL or MS SQL databases.

The script utilises a text-based database and creates a drop down box for manufacturer, once selected the model selection box is shown, and finally the cartridges for the selected printer.

Note: As Setch found out, this script only works on >PHP 5; due to the use of 'public' variables within the classes, if you need to run this on a lower version of PHP, you can replace the public clause with 'var'.

Demo

Below is a working copy of the Ink Finder, and what it could look like on your web site. It uses a few sample manufacturers and cartridges.

Manufacturer:

Download

I haven't written a README.TXT for this script and am not documenting (in detail) how to use it on the basis that if you're implementing it, you should know what you're doing anyway. The main file (ink_finder.php) has an options section at the top where you can specify variables, this is commented.

Sample files are included in the zip, see below for the text-based database instructions. This script is released under the GNU Public License.

php_ink_finder.zip (32Kb)

Using this Script

As I said, I'm not going into huge detail on how to use this script. If you do have problems using the script, feel free to contact me for help, if I get too many requests I will add more information to this page. The sample.php page included in the archive can be modified and used as a default page, or to add the script to an existing PHP page, simply add the line:

<?php include('/path/to/file/ink_finder.php'); ?>

Where-ever you want the Ink Finder to appear on the page.

The database is in the format:

make|model|part number|description|price|url|image

Note that the image path should related to the location of the file that includes 'ink_finder.php' and not the location of the Ink Finder script.