Browse Source

CAPTCHA

master
Matthilde 8 months ago
parent
commit
c51b0d11a7
2 changed files with 30 additions and 5 deletions
  1. +1
    -0
      .gitignore
  2. +29
    -5
      src/register.php

+ 1
- 0
.gitignore View File

@ -1 +1,2 @@
out/*
static/securimage/*

+ 29
- 5
src/register.php View File

@ -1,3 +1,4 @@
<?php session_start(); ?>
<style>
input { width: 100% }
textarea { width: 100% }
@ -14,21 +15,44 @@
understand why you've been banned if ever you break rules.
</p>
<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
include_once $_SERVER['DOCUMENT_ROOT'] . '/securimage/securimage.php';
$securimage = new Securimage();
if ($securimage->check($_POST['captcha_code']) == false)
{
$error = "Wrong captcha.";
} else
{
$error = "This service is not available for registration at the moment. Please come back later.";
}
}
?>
<p style="color: red"><?php echo $error; ?></p>
<form method="post" action="#">
<label>Username</label><br />
<input type="text" name="username" disabled /><br /><br />
<input type="text" name="username" /><br /><br />
<label>E-mail Address</label><br />
<input type="email" name="email" disabled /><br /><br />
<input type="email" name="email" /><br /><br />
<!-- TODO: Link to a page about how to get an SSH pubkey -->
<label>SSH public key</label><br />
<input type="text" name="pubkey" disabled /><br /><br />
<input type="text" name="pubkey" /><br /><br />
<label>What does brings you here?</label><br />
<textarea name="description" rows=15 disabled
<textarea name="description" rows=15
placeholder="Be clear, you don't have to write a whole essay."></textarea>
<br /><br />
<input type="submit" value="Registrations are closed" disabled />
<center>
<img id="captcha" src="/securimage/securimage_show.php" alt="captcha" />
</center>
<input type="text" name="captcha_code" size="10" maxlength="6" />
<input type="submit" value="Register" />
</form>

Loading…
Cancel
Save