PHP Classes

File: uploady/signup.php

Recommend this page to a friend!
  Classes of Faris AL-Otabi   Uploady PHP Upload File to MySQL   uploady/signup.php   Download  
File: uploady/signup.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Uploady PHP Upload File to MySQL
Store file upload details in a MySQL database
Author: By
Last change: Protect sign up with recaptcha, and fix login for iinactivated user
Date: 4 months ago
Size: 3,473 bytes


Class file image Download
include_once 'session.php';
APP_PATH . 'logic/signupLogic.php';

<?php include_once 'components/header.php'; ?>

<div class="container pb-5 pt-5">
    <div class="row justify-content-center text-center">
        <div class="col-sm-12 col-md-8 col-lg-4">
            <div class="card">
                <div class="card-header">
                    <b><?= $lang["general"]['signup_title']; ?></b>
                <div class="card-body">
                    <?php if (isset($error)) : ?>
<?= $utils->alert($error, 'danger', 'times-circle'); ?>
<?php endif; ?>
<?php if (isset($msg)) : ?>
<?= $utils->alert($msg, 'success', 'check-circle'); ?>
<?php endif; ?>
<form method="POST">
                        <div class="mb-3">
                            <input type="text" class="form-control" name="username" placeholder="<?= $lang["general"]['enter_username']; ?>" required>
                        <div class="mb-3">
                            <input type="email" class="form-control" name="email" placeholder="<?= $lang["general"]['enter_your_email']; ?>" required>
                        <div class="mb-3">
                            <input type="password" class="form-control" name="password" placeholder="<?= $lang["general"]['enter_password']; ?>" required>
                        <div class="form-check m-3 text-start">
                            <input type="checkbox" class="form-check-input" id="tos" required>
                            <label class="form-check-label" for="tos">
                                <?= $lang["general"]['i_agree'] ?> <a href="page.php?s=terms"><?= $lang["general"]['tos_short'] ?></a>
                        <?php if ($settings->getSettingValue('recaptcha_status') == true) : ?>
<input type="hidden" name="recaptcha_response" id="recaptchaResponse">
                        <?php endif; ?>
<div class="text-center">
                            <button type="submit" class="btn btn-primary">
                                <?= $lang["general"]['signup_button'] ?>
                <div class="card-footer mb-0">
                    <a href="<?= $utils->siteUrl('/login.php'); ?>">
                        <?= $lang["general"]['login_cta_msg']; ?>

<?php if ($settings->getSettingValue('recaptcha_status') == true) : ?>
<script src="<?php echo $settings->getSettingValue('recaptcha_site_key'); ?>"></script>
        grecaptcha.ready(function() {
            grecaptcha.execute('<?php echo $settings->getSettingValue('recaptcha_site_key'); ?>', {
                action: 'login_form'
            }).then(function(token) {
                var recaptchaResponse = document.getElementById('recaptchaResponse');
                recaptchaResponse.value = token;
<?php endif; ?>

<?php include_once 'components/footer.php'; ?>