Showing posts with label effective. Show all posts
Showing posts with label effective. Show all posts

Sunday, June 5, 2016

PHP CAPTCHA Script A Simple But Effective Free CAPTCHA Script in PHP

PhpCaptcha php script is a library for generating visual and audio CAPTCHAs (completely automated public Turing test to tell computers and humans apart). You can read more about CAPTCHAs at Wikipedia.

It can help you to prevent/reduce:

  •     Automated sign-ups in registration forms.
  •     Comment spam in blogs and guestbooks.
  •     Brute force attacks on login systems.


A Word of Warning

OK, so this might sounds strange given what follows but please consider whether you really need to use a CAPTCHA before implementing this on your site. Although its legitimate to use CAPTCHAs in some situations you really need to be aware of the inherent accessibility pitfalls before implementing. Id also encourage you to fully investigate the alternatives such as the Akismet spam filtering WordPress plug-in and API before resorting to a CAPTCHA to solve your spam problems.

Right, Ive said my piece - on with the script.

Origins

The library is loosely based on an article I wrote for SitePoint which was published on 9th November 2005 - Toughen Forms Security with an Image.

Supported Features

  •     Multiple random TrueType fonts
  •     Character rotation
  •     Optional chararacter shadow support
  •     Optional site owner display text
  •     Random custom background images
  •     Font size selection
  •     Greyscale or colour lines and characters
  •     Character set selection
  •     Integration of validation function for checking the user entered code with the generated code

Requirements

The library requires PHP 4 compiled with GD 1 or 2 (Image Generation) and FreeType text support. It should work fine with Linux, Mac OS X or Windows based systems although you will need to change the default temporary file storage directory specified when using with Windows. PHP session support is also required. The audio CAPTCHA requires the Flite text to speech synthesis engine - more details on set up below.

License

PhpCaptcha is licensed under the Free BSD license.

Implementation Steps:

Step 1

Unzip and copy the php-captcha.inc.php to a directory within your site.

Step 2

To create a basic visual CAPTCHA with the minimal options create a new file (visual-captcha.php) containing the code shown below.


 <?php
require(php-captcha.inc.php);
$aFonts = array(fonts/VeraBd.ttf, fonts/VeraIt.ttf, fonts/Vera.ttf);
$oVisualCaptcha = new PhpCaptcha($aFonts, 200, 60);
$oVisualCaptcha->Create();
?>

Step 3

To create an audio CAPTCHA create a new file (audio-captcha.php) containing the code shown below. For this to work youll need to ensure that your have a working installation of Flite.
 <?php
require(php-captcha.inc.php);
$oAudioCaptcha = new AudioPhpCaptcha(/usr/bin/flite, /tmp/);
$oAudioCaptcha->Create();
?>

You need to pass the path to the Flite binary and the temporary directory you want to use for storing generated audio CAPTCHAs to the class constructor. Alternatively you can modify the corresponding constants in the library file and then omit the parameters in the constructor.

Step 4

Include the visual and audio CAPTCHAs in your application/form with the following code. The audio CAPTCHA should ideally follow the visual CAPTCHA in the source code. This will ensure the visual CAPTCHA has generated a random code before the audio CAPTCHA is called.


 <p><img src="visual-captcha.php" width="200" height="60" alt="Visual CAPTCHA" /></p>
<p><a href="audio-captcha.php">Cant see the image? Click for audible version</a></p>

Step 5

On form submission you need to check the code the user enters with the one generated by the CAPTCHA. You can do this with the following code assuming that the user entered code was submitted in an HTML POST form field "user_code".


 <?php
require(php-captcha.inc.php);
if (PhpCaptcha::Validate($_POST[user_code])) {
echo Valid code entered;
} else {
echo Invalid code entered;
}
?>

Please note that the Validate method needs to be called statically, i.e you dont create an instance of the class before calling it.

Configuration Options

  1. SetWidth(int iWidth) - set the width of the CAPTCHA image. Defaults to 200px.
  2. SetHeight(int iHeight) - set the height of the CAPTCHA image. Defaults to 50px.
  3. SetNumChars(int iNumChars) - set the number of characters to display. Defaults to 5.
  4. SetNumLines(int iNumLines) - set the number of interference lines to draw. Defaults to 70.
  5. DisplayShadow(bool bShadow) - specify whether or not to display character shadows.
  6. SetOwnerText(sting sOwnerText) - owner text to display at bottom of CAPTCHA image, discourages attempts to break your CAPTCHA through display on porn and other unsavoury sites.
  7. SetCharSet(variant vCharSet) - specify the character set to select characters from. If left blank defaults to A-Z. Can be specified as an array of chracters e.g. array(1, G, 3) or as a string of characters and character ranges e.g. a-z,A-Z,0,3,7.
  8. CaseInsensitive(bool bCaseInsensitive) - specify whether or not to save user code preserving case. If setting to "false" you need to pass "false" as the second parameter to the "Validate" function when checking the user entered code.
  9. SetBackgroundImages(variant vBackgroundImages) - specify one (a string) or more (an array) images to display instead of noise lines. If more than one image is specified the library selects one at random.
  10. SetMinFontSize(int iMinFontSize) - specify the minimum font size to display. Defaults to 16.
  11. SetMaxFontSize(int iMaxFontSize) - specify the maximum font size to display. Defaults to 25.
  12. UseColour(bool bUseColour) - if true displays noise lines and characters in randomly selected colours.
  13. SetFileType(string sFileType) - specify the output format jpeg, gif or png. Defaults to jpeg.
The methods listed below allow you to refine the look and feel as well as the behaviour of the generated CAPTCHA. They should all be called before the "Create" method.

Download Free PHP CAPTCHA Script

Monday, February 1, 2016

5 Effective Tips to Focus on Study of University Students Study Tips

Students of university are busiest student ever! Because they are older student and needed to maintain(most often) the cost of their study while they are in university to achieve higher educational degree. But the real picture of study materials tell different thing that they need to capture more thing than a school level student but they have less time to be prepared for their exam.

After considering above status of students of university, Ive enlisted 5 effective study tips so that these tips may help such students deeply.

1. Fix A Schedule To Study: I know you are busy with other tasks as well as study. But your main focus is to study and achieve higher education. So, dont forget your main goal. To achieve educational goal, you can set up your daily schedule so that you can make your exam preparation on that time. Place your books on your table and start studying when that time come. But if you get extra free time, you can use it to get more outcome.

2. Be Regular: Whatever you are doing in order to supply the money of your cost in order to study, You should be seat down to study regularly on your daily fixed time.

3. Planning: Before jumping on study with a hungry mind, you should be careful to make an effective study plan. Because, It will encourage you and you will be able to know that you are going forward rightly.

4. Procrastination Avoiding: Such problem may be the greatest problem for university students. Procrastination makes hindrances to be regular on study. Because, an university student has the talent which requires to become successful. But procrastination places an obstacle and remains stopped him or her to study.

5. About You: To become successful and achieving your academic goal, you should know yourself first. You should judge your real capabilities. You need to take care of your own health in order to be fit for study and work.

Thursday, January 28, 2016

Effective Study Tips To Make Study Within Short Time

To make study properly and get better educational result, a student should focus on his or her study regularly. We know it better. But, there is another thing which should be taken care of and need to focus which is making the learning process easy and effective as well as creative. If a student can get that, the study process becomes more easier, enjoyable and effective. So, to become a good student, A student should learn also how to study better including learning his or her regular academic lessons.

In this article of study tips from Bangla Books PDF, I am going to enlist some necessary study tips to make the study effective and get better output consuming short time.

1. Concentration: It is the key point to make study within short time. Or in other word, without enough concentration, learning process goes to be slow. So, what happens if you can learn double thing within that time which you spend regularly to make your study? It is the concentration which will give you that opportunity.

Tip: To get enough concentration on a task, you need to love the task from heart and soul. To get strong concentration on study, you need to love study first.

Check Out: 5 Effective Study Tips To Achieve Your Study Goal



2. Review: Human mind bears so much information and trends to forget! It is as usual. Because, in the path of our daily activities, we watch and observe so many things. So, without review on important things, we will forget that after a period. It is so normal!

Tip: To avoid forgetting a learned thing, you need to spend a time on it to review again. Such as, after completion of your class, try to review the educational materials. And try to review your learned things at least weekly. It is best trying this for several times in a week. Such activities will provide you better output for exam.

Check Out: 5 Tips To Focus On Study Regularly For University Students



3. Again Concentration: To make concentration, you should make your study on a comfortable place for study. The place for study matters huge. Because, it brings the concentration which must necessary to get best output of your hard work for better academic educational result.

Tip: Try to decorate your own study room. Or try to manage a study room which is favorable for study.

Check Out: Why should You Take Care of Your Study Environment


4. Relaxing: Dont make your head full of load! Yes! Dont try to make your study by forcing your mind to be sticky on it. Whenever, you feel tried for study, try to take a music break.

Tip: You may use your earphone to hear nice music. Music may help you to feel the enjoyment and make you fresh. But dont do it overdo.

Check Out: Essential Elements of Making Study


5. Understanding Your Materials: Just dont try to memorize things without understanding. It is so harmful and make pressure on your memory because, It has the good chance to forget if there is no enough revision. And it is harmful for getting real objectives from study.

Tip: Be strong and open minded. Dont be shy to ask a question if you dont understand or know the answer. Try to take the help of your teachers and your friends who know the matter well.

Check Out: How to Study Much



Five educational tips or study tips are shown above. The main objective of these tips is to help students to make their study better within short time or effective. If you are a student, and read this article right now, dont avoid these study tips after reading. Try to feel these and use for your better academic result.