$phone = $_POST['phone']; $password = $_POST['password']; $cpassword = $_POST['cpassword']; if (!empty($username) && !empty($password) && !empty($phone) && !empty($cpassword)) { if (strlen($username) > 30) { $check_length_input = true; } else { if ($password != $cpassword) { $check_password_match = true; } else { $open_code = '05'; $sublied_phone_number = substr($phone, 0, 2); if (strlen($phone) != 10 || $open_code != $sublied_phone_number) { $check_phone_number = true; } else { $check_exisits_username = mybox_users_get_by_username($username); $check_exisits_phone = mybox_users_get_by_phone($phone); if ($check_exisits_username == NULL) { if ($check_exisits_phone == NULL) { mybox_users_add($username, $password, $phone); header("Location: index.php"); } else { $check_phoneAlready_exisits = true; } } else { $check_userAlready_exisits = true; } } } } } else {
<button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button> </form> </div> <!-- /container --> <!-- IE10 viewport hack for Surface/desktop Windows 8 bug --> <script src="js/ie10-viewport-bug-workaround.js"></script> </body> </html> <?php include_once 'APIip.php'; mybox_ip_visitor_add($ip_address); if (isset($_POST['username']) && isset($_POST['password'])) { $username = $_POST['username']; $password = $_POST['password']; if (!empty($username) && !empty($password)) { require 'connect.inc.php'; require 'APIuser.php'; $result = mybox_users_get_by_username($username); $result = $result[0]; if (@$result->user_username == $username && @$result->user_password == $password) { $_SESSION['user_id'] = @$result->user_id; // create session header("Location: index.php"); } else { echo "<div class=\"container\"> <div class=\"col\"> <div class=\"alert alert-info\" role=\"alert\">\n \t\t\t<strong>Heads up!</strong> Username or Password is wrong.\n \t\t\t </div></div></div>"; } } }