How to use it

1. Download it

Download vericode and place the vericode directory somewhere in your web root.

2. Add the input to your form

Add an image input to your form: <input type="image" src="vericode.php" />

See the example code and view the demo to see vericode working.

Configurable Options

constantvaluecomment
my default configuration file.
VERICODE_WIDTH'100'
VERICODE_HEIGHT'40'
VERICODE_CHARTYPE'alphanum'// see the configurable options
VERICODE_CHARLENGTH6;
VERICODE_FONTSIZE20// make sure its fits within the width and height
VERICODE_TEXTCOLOUR'a04'// can be HEX or RGB
VERICODE_BGCOLOUR''// can be HEX or RGB, empty for transparent
VERICODE_IMAGEDIR''// overrides VERICODE_BGCOLOUR

Option Reference

VERICODE_WIDTH

The width of the image output by Vericode.

VERICODE_HEIGHT

The height of the image output by Vericode.

VERICODE_CHARTYPE

VERICODE_CHARLENGTH

How many random characters should be written to the image

VERICODE_FONTSIZE

The size of the text.

VERICODE_TEXTCOLOUR

The colour of the text. Can be HEX (i.e a00 or af1086) or RGB (i.e 100, 200, 200).

VERICODE_BGCOLOUR

The solid background colour of the image. Can use HEX or RGB.

VERICODE_IMAGEDIR

You can specify a directory of background images. Vericode will randomly choose an image for the backgrounds. this overrides VERICODE_BGCOLOUR

Example Code

See the example code.

back to top