Location: PHPKode > scripts > IRV > kbjr-IRV-5c9960c/example.php
<?php

/*
 * example.php
 *
 * Software: IRV - Image Recognition Verification
 * Version:  0.1.1 Dev
 * Author:   James Brumond
 * Created:  13 May, 2010
 * Updated:  13 May, 2010
 *
 * Copyright 2010 James Brumond
 * Dual licensed under MIT and GPL
 */

require dirname(__FILE__) . "/IRV.php";

$irv_check = IRV::check_test();
if ($irv_check === false) {
	$msg = '<div class="bad">incorrect!</div>';
} elseif ($irv_check === true) {
	$msg = '<div class="good">correct!</div>';
}

$irv_test = IRV::build_test('%l%b%i%L<br />');

?>

<style type="text/css">

	* {
		font-family: sans-serif;
	}
	
	div.good, div.bad {
		display: inline-block;
		padding: 1em 3em;
		margin: 1em 0.5em;
	}

	div.good {
		color: #282;
		border: 1px #282 solid;
		background: #bfb;
	}
	
	div.bad {
		color: #822;
		border: 1px #822 solid;
		background: #fbb;
	}

	.irv-text {
		display: block;
		margin-bottom: 1em;
	}
	
	.irv-item {	
		text-align: center;
	}
	
	.irv-item img {
		display: inline;
	}
	
	.irv-item input {
		display: inline;
	}

</style>

<h2>IRV: Image Recognition Verification</h2>

<?php echo $irv_test[0] . $msg; ?>

<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">

	<?php echo $irv_test[1]; ?>

	<input type="submit" value="Submit" />

</form>


Return current item: IRV