Login   Register  
PHP Classes
elePHPant
Icontem

File: index.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Peeyush Budhia  >  PHP Math Captcha  >  index.php  >  Download  
File: index.php
Role: Auxiliary script
Content type: text/plain
Description: Index File
Class: PHP Math Captcha
Generate CAPTCHA images with math operations
Author: By
Last change:
Date: 1 year ago
Size: 1,252 bytes
 

Contents

Class file image Download
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Captcha Validation</title>
</head>
<body>

<div style="text-align: center; color: blueviolet; font-size: x-large; margin-bottom: 10px;">Captcha Validation</div>
<?php
if (isset($_GET['success'])) {
    echo 
"<div style=\"text-align: center; color: forestgreen; margin-bottom: 10px;\">$_GET[success]</div>";
}
if (isset(
$_GET['error'])) {
    echo 
"<div style=\"text-align: center; color: firebrick; margin-bottom: 10px;\">$_GET[error]</div>";
}
?>
<table style="text-align: center;" align="center">
    <form action="validate.php" method="post">
        <tr>
            <td>
                <img src="getCaptcha.php" alt="Are you human?" id="captcha"/>
            </td>
            <td>
                <a href="#" onclick=" document.getElementById('captcha').src='getCaptcha.php'; document.getElementById('code').focus();" id="change-image">Refresh</a>
            </td>

        </tr>
        <tr>
            <td colspan="2"><input type="text" name="code" size="30" id="code"/></td>
        </tr>
        <tr>
            <td colspan="2"><input type="submit" value="Check"/></td>
        </tr>

    </form>
</table>
</body>
</html>