Develop new style of Captcha.

Developing your new type of Captcha

Step 1:Install Captchaclick service

About how to install Captchaclick service,please click here

Step 2: You need to write an new procedure which return gdImagePtr.


	
gdImagePtr YourCaptchaProc(int picturewidth,int pictureheight,DeskPoint * clickpoint,int & clickorder)
{
	gdImagePtr yourimage;
	//You paint the image and assign the points which will be clicked by user.
	//...
	return yourimage;
}	
	

  picturewidth and pictureheight is the width and height of the captcha picture. clickpoint is an DeskPoint array which store the postions which need to be clicked by user. If you need to user click the points by order, then you assgin clickorder as 1.

  DeskPoint is an struct with members x and y which actually an point defination. finally the yourimage which as return value will be push to user as captcha. User click the image and captchaclick service will compare with the positions already defined with clickpoint array.

Step 3:You need to register the new procedure.

The register procedure is "SetRecapthca(int BusId,RecaptchaProc Proc). BusId range from 8 to 1000. Every digit assign to one type of captcha. You can assign this type of Captcha by CSS in HTML file like:


	 <img class="initdata_picture_verification"  veristyle="9" /> 

If you finished "YourCaptchaProc" then register it as:


	SetRecaptcha(YourcaptchaProc,9);

The whole codes should be added at "/usr/local/captchaclick/start.cpp"


gdImagePtr YourCaptchaProc(int picturewidth,int pictureheight,DeskPoint * clickpoint,int & clickorder)
{
	gdImagePtr yourimage;
	//You paint the image and assign the points which will be clicked by user.
	//...
	return yourimage;
}	
int main()
{
	
	//You code here.
	SetRecaptcha(YourcaptchaProc,9);
}

Install it and restart the web serivce,it should works.

	cd /usr/local/captchaclick
	make
	make install
	service captchaclick restart