mirror of
https://github.com/getnamingo/registry.git
synced 2025-06-28 15:13:27 +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
|
<?php
|
||||||
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
|
use Gregwar\Captcha\PhraseBuilder;
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||||
|
@ -7,7 +10,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_POST['captcha'] !== $_SESSION['captcha']) {
|
if (PhraseBuilder::comparePhrases($_SESSION['captcha'], $_POST['captcha'])) {
|
||||||
echo json_encode(['error' => 'Incorrect Captcha.']);
|
echo json_encode(['error' => 'Incorrect Captcha.']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,10 +3,9 @@ require 'vendor/autoload.php';
|
||||||
|
|
||||||
use Gregwar\Captcha\CaptchaBuilder;
|
use Gregwar\Captcha\CaptchaBuilder;
|
||||||
|
|
||||||
session_start();
|
$builder = new CaptchaBuilder();
|
||||||
|
|
||||||
$builder = new CaptchaBuilder;
|
|
||||||
$builder->build();
|
$builder->build();
|
||||||
|
session_start();
|
||||||
$_SESSION['captcha'] = $builder->getPhrase();
|
$_SESSION['captcha'] = $builder->getPhrase();
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue