Comments form captcha

From Photostand Wiki

Jump to: navigation, search
comments_form_captcha(prefix, class, suffix)

The comments_form_captcha function will return the captcha image and field if the security level is set to captcha. If not, it will return nothing.

Parameters

  • Prefix : String value

HTML value that must be displayed before the captcha image.

  • Class : String value - Default : captcha

Defines the field class.

  • Suffix : String value

HTML value that must be displayed after the captcha field.

Examples

Displaying the captcha

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <head>

	<title>Article</title>

    </head>
    <body>

        <form action="index.php" method="post">
	    <?php echo comments_form_hidden(); ?>
            <textarea name="comment"></textarea>
	    <?php echo comments_form_captcha('', 'captcha', ''); ?>
            <input type="submit" value="Post comment" />
	</form>

    </body>
</html>

Here, it will add the captcha field just above the submit button if the security level is set to captcha.

Personal tools