} } if (empty($errors) === true) { if (user_exits($_POST['username']) === true) { $errors[] = 'Sorry, The username \'' . $_POST['username'] . '\' is already taken.'; } if (preg_match("/\\s/", $_POST['username']) == true) { $errors[] = 'Your Username must not contain space.'; } if (strlen($_POST['password']) < 6) { $errors[] = 'Your password must be at least 6 characters'; } if ($_POST['password'] != $_POST['password_again']) { $errors[] = 'Password do not match.'; } if (email_exits($_POST['email']) === true) { $errors[] = 'Sorry, The Email \'' . $_POST['email'] . '\' is already in use.'; } if (mobile_number_exits($_POST['mobile_number']) === true) { $errors[] = 'Sorry, The Mobile Number \'' . $_POST['mobile_number'] . '\' is already in use.'; } if (strlen($_POST['mobile_number']) > 10 || strlen($_POST['mobile_number']) < 10) { $errors[] = 'Enter valid mobile number'; } } } ?>
<div class="col-sm-12 "> <div class="logo text-center"> <a href="index.php"><img src="images/home/logo.png" alt="" /></a> </div> </div> </div> </div> </div><!--/header-middle--> </header><!--/header--> <?php require 'html/php/includes/head.req.php'; if (isset($_GET['email'], $_GET['email_code']) === true) { $email = trim($_GET['email']); $email_code = trim($_GET['email_code']); if (email_exits($email) === false) { $errors[] = 'Oops, something went wrong,and we couldn\'t find that Email address!'; } elseif (activate($email, $email_code) === false) { $errors[] = 'We had problems Activating your account'; } if (empty($errors) === false) { ?> <div class="container"> <h2>Oops...</h2> <div class="alert alert-danger" role="alert"> <?php echo output_errors($errors); ?> </div></div><?php } else { header('Location: /?active');
<?php include 'core/init.php'; protect_page(); if (empty($_POST) === false) { $required_fields = array('first_name', 'email', 'mobile_number'); foreach ($_POST as $key => $value) { if (empty($value) && in_array($key, $required_fields) === true) { $errors[] = 'Fields marked with an * are required'; break 1; } } if (empty($errors) === true) { if (email_exits($_POST['email']) === true && $user_data['email'] != $_POST['email']) { $errors[] = 'Sorry, The Email \'' . $_POST['email'] . '\' is already in use.'; } if (strlen($_POST['mobile_number']) > 10 || strlen($_POST['mobile_number']) < 10) { $errors[] = 'Enter valid mobile number'; } } } echo "<title>{$user_data['first_name']} | Shoppcart</title> "; require 'html/php/includes/head.req.php'; require 'html/php/includes/header.req.php'; ?> <!--This is header--> <div class="container"> <div class="row"> <div class="col-sm-3 col-lg-3 col-md-3"> <div class="panel panel-warning"> <div class="panel-body ">