<?php
} else{//form is posted
include("securimage.php");
$img=new Securimage();
$valid=$img->check($_POST['code']);//检查用户的输入是否正确
if($valid==true) {
echo "<center>Thanks, you entered the correct code.</center>";
} else{
echo "<center>Sorry, the code you entered was invalid. <a href=\"javascript:history.go(-1)\">Go back</a> to try again.</center>";
}
}
?>
</body>
</html>
securimage_show.php的代码:
<?php
include 'securimage.php';//下载包里面的核心类库代码
$img=new securimage();
$img->show();// alternate use: $img->show('/path/to/background.jpg');
?>