How to add Captcha verification in the comments of the Yii blog demo

This post is about adding captcha verification in the comments section of the Yii demo blog. This post was triggered from two comments posted on the page of the tutorial (Comment 1 and Comment 2). In order for you to follow through the current post you need to have the Yii framework in place and you need to have followed all the steps of the Blog Tutorial up untill the “Creating and Displaying Comments” section. So, let’s start:

If you have followed the tutorial you should by now have a working Leave a comment form in place that is displayed underneath each individual post of your blog web application. The form should contain the Name, Email, Website and Comment fields that will populate the corresponding properties of your Comment model. The Post ID should be set on submit, the Status of the Comment should also be set on submit and the Time Created should be set just before saving the Comment (if this is a newly created comment).

Continue reading “How to add Captcha verification in the comments of the Yii blog demo”