mirror of
https://github.com/hnhx/captcha.git
synced 2025-01-09 11:17:26 -03:00
25 lines
No EOL
622 B
PHP
25 lines
No EOL
622 B
PHP
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Captcha example</title>
|
|
</head>
|
|
<body>
|
|
<form method="post">
|
|
<input type="text" name="captcha">
|
|
<button type="submit">Check</button>
|
|
</form>
|
|
|
|
<img src="captcha.php" alt="captcha">
|
|
|
|
<?php
|
|
if (isset($_REQUEST["captcha"]))
|
|
{
|
|
session_start();
|
|
echo "<p>";
|
|
echo ($_SESSION["captcha"] == $_REQUEST["captcha"] ? "Valid" : "Invalid") . " captcha";
|
|
echo "</p>";
|
|
}
|
|
?>
|
|
|
|
</body>
|
|
</html>
|