mirror of
https://github.com/getnamingo/registry.git
synced 2025-06-28 07:03:28 +02:00
Small Web Whois update
This commit is contained in:
parent
11c158be04
commit
7ded823b5c
2 changed files with 6 additions and 4 deletions
|
@ -1,4 +1,7 @@
|
|||
<?php
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use Gregwar\Captcha\PhraseBuilder;
|
||||
session_start();
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
|
@ -7,7 +10,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|||
exit;
|
||||
}
|
||||
|
||||
if ($_POST['captcha'] !== $_SESSION['captcha']) {
|
||||
if (PhraseBuilder::comparePhrases($_SESSION['captcha'], $_POST['captcha'])) {
|
||||
echo json_encode(['error' => 'Incorrect Captcha.']);
|
||||
exit;
|
||||
}
|
||||
|
|
|
@ -3,10 +3,9 @@ require 'vendor/autoload.php';
|
|||
|
||||
use Gregwar\Captcha\CaptchaBuilder;
|
||||
|
||||
session_start();
|
||||
|
||||
$builder = new CaptchaBuilder;
|
||||
$builder = new CaptchaBuilder();
|
||||
$builder->build();
|
||||
session_start();
|
||||
$_SESSION['captcha'] = $builder->getPhrase();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue