PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of Faris AL-Otabi   FCaptcha   index.php   Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Example script
Class: FCaptcha
Verify if the user is a human with a CAPTCHA image
Author: By
Last change:
Date: 1 year ago
Size: 748 bytes
 

Contents

Class file image Download
<?php
session_start
();

include_once
'./src/FCaptcha.php';

$c = new FCaptcha;

if (
$_SERVER['REQUEST_METHOD'] == 'POST') {
    echo
$c->checkCaptch($_POST['captcha']) ? 'Captcha OK' : 'Captcha Bad';
}
?>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <form action="" method="post">
        <div>
            <img src="captcha.php" alt="">
        </div>
        <div>
            <input type="text" name="captcha" id="">
        </div>
        <div>
            <button type="submit">Check</button>
        </div>
    </form>



</body>

</html>