PHP Classes

File: example/inc/activationform.php

Recommend this page to a friend!
  Classes of Ashraf Gheith   PHP Secure Login and Registration   example/inc/activationform.php   Download  
File: example/inc/activationform.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: PHP Secure Login and Registration
Register and login users in a database with PDO
Author: By
Last change: Fixed some bugs and security issues
Date: 7 years ago
Size: 1,177 bytes
 

Contents

Class file image Download
<h1>Activate a new account</h1>
<div class="form-group">
    <input type="text" name="username" id="useractivation" tabindex="3" class="form-control" placeholder="Email" value="">
</div>
<div class="form-group">
    <input type="text" name="code" id="activationcode" tabindex="4" class="form-control" placeholder="Activation code">
</div>
<div class="form-group">
    <div class="row">
        <div class="col-sm-6 col-sm-offset-3">
            <input type="button" name="activate-submit" id="activate-submit" tabindex="4" class="form-control btn btn-login" value="Send">
        </div>
    </div>
</div>
<script type="text/javascript">
    $(function() {
        $("#activate-submit").click(function(){
            if($("#useractivation").val() != "" && $("#activationcode").val() != "" && validateEmail($("#useractivation").val())){
                $.ajax({
                  method: "POST",
                  url: "<?=activatefile?>",
                  data: { email: $("#useractivation").val(), code: $("#activationcode").val() }
                }).done(function( msg ) {
                    if(msg !== ""){
                        alert(msg);
                    }else{
                        window.location = "<?=userfile?>";
                    }
                });
            }else{
                alert("Please fill all fields with valid data!");
            }
        });
    });
</script>