Skip to content

Instantly share code, notes, and snippets.

@emmykolic
Created December 23, 2022 13:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emmykolic/2554b8b502e63706feb402ec68c26d10 to your computer and use it in GitHub Desktop.
Save emmykolic/2554b8b502e63706feb402ec68c26d10 to your computer and use it in GitHub Desktop.
the form page after the captcha has been validated
<?php
include 'config.php';
include 'header.php';
?>
<div class="container">
<div class="row">
<div class="col-md-6 offset-md-3 mt-5 shadow">
<form method="post" class="bg-white p-5" action="register_action.php">
<div class="bg-success text-center text-white fbold fs-6"><?= get_alert()?></div>
<?php
/*if captcha code is posted*/
if(isset($_POST["captcha"]))
if($_SESSION["captcha"]==strtolower($_POST["captcha"])):/*CAPTCHA is valid. You can process the form now.*/?>
<div class=" bg-success text-center p-2 text-white fw-bold fs-6"> CAPTCHA is valid. You can process the form now.</div>
<?php else: /*Invalid CAPTCHA*/
header("location: index.php");
?>
<p class="text-danger">Invalid <strong>CAPTCHA.</strong> Pls Try again!</p>
<?php endif; ?>
<h2 class="mt-2">Registration</h2>
<div class="mb-3">
<label>Fullname <span class="text-danger">*</span></label>
<input type="text" id="captchha" name="fullname" size="20" class="form-control m-1">
</div>
<div class="mb-3">
<label>Gender <span class="text-danger">*</span></label>
<input type="text" id="captchha" name="gender" size="20" class="form-control m-1">
</div>
<div class="mb-3">
<label>Email <span class="text-danger">*</span></label>
<input type="email" id="captchha" name="email" size="20" class="form-control m-1">
</div>
<div class="mb-3">
<input type="submit" name="submit" value="Submit" class="btn btn-success col-12 m-1">
</div>
</form>
</div>
</div>
</div>
<?php include 'footer.php'; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment