function addUser($username, $email, $firstname, $lastname, $gender, $address1, $address2, $country, $contactnumber, $password)
{
    if (hasNotSensitiveCharacters($username)) {
        if (hasNotSensitiveCharacters($email)) {
            if (hasNotSensitiveCharacters($firstname)) {
                if (hasNotSensitiveCharacters($lastname)) {
                    if (hasNotSensitiveCharacters($gender)) {
                        if (hasNotSensitiveCharacters($address1)) {
                            if (hasNotSensitiveCharacters($address2)) {
                                if (hasNotSensitiveCharacters($country)) {
                                    if (hasNotSensitiveCharacters($contactnumber)) {
                                        if (hasNotSensitiveCharacters($password)) {
                                            if ($gender != "Select a gender" && $country != "Select a country") {
                                                if (!(isUserExistsByUsername($username) || isUserExistsByEmail($email))) {
                                                    if (isNonFetchQuerySuccess("INSERT INTO user_profile_details (username, first_name, last_name,gender,address_line1,country,email,address_line2,picture_file_path,contact_number) VALUES ('{$username}', '{$firstname}','{$lastname}' , '{$gender}' , '{$address1}', '{$country}', '{$email}', '{$address2}', '', '{$contactnumber}')")) {
                                                        $password = encodeString($password);
                                                        if (isAdminAlreadyExists($username)) {
                                                            isNonFetchQuerySuccess("INSERT INTO user_login (username, password , status) VALUES ('{$username}', '{$password}', 'NORMAL USER')");
                                                        } else {
                                                            isNonFetchQuerySuccess("INSERT INTO user_login (username, password , status) VALUES ('{$username}', '{$password}', 'ADMIN USER')");
                                                        }
                                                        $_SESSION['firstSignIn'] = "Successfully signed up! <br> Now you can login here";
                                                        redirect_to("home");
                                                    } else {
                                                        return "Registration Failed";
                                                    }
                                                } else {
                                                    if (isUserExistsByUsername($username)) {
                                                        return "Username is not available";
                                                    } else {
                                                        if (isUserExistsByEmail($email)) {
                                                            return "Email already exists";
                                                        }
                                                    }
                                                }
                                            }
                                        } else {
                                            return "Password has Invalid characters";
                                        }
                                    } else {
                                        return "Contact number has Invalid characters";
                                    }
                                } else {
                                    return "Country has Invalid characters";
                                }
                            } else {
                                return "Address Line 2 has Invalid characters";
                            }
                        } else {
                            return "Address Line 1 has Invalid characters";
                        }
                    } else {
                        return "Gender has Invalid characters";
                    }
                } else {
                    return "Last name has Invalid characters";
                }
            } else {
                return "First name has Invalid characters";
            }
        } else {
            return "Email has Invalid characters";
        }
    } else {
        return "Username has Invalid characters";
    }
}
<?php

require "includes/mysql_database_connection.php";
include "includes/profile_management_function.php";
include "includes/forgot_password_function.php";
require "includes/util.php";
require "includes/session.php";
redirectToHTTPS();
if (isset($_SESSION['username'])) {
    redirect_to("signedInUserHome.php");
} else {
    if (isset($_POST['forgotPWSubmit'])) {
        $emailToForgotPassword = $_POST['email'];
        if (isUserExistsByEmail($emailToForgotPassword)) {
            $msg = sendMail($emailToForgotPassword);
        } else {
            $msg = "Email does not exists";
        }
    } else {
        $msg = "";
        $emailToForgotPassword = "";
    }
}
?>

<script type="text/javascript" language="javascript" src="js/forgotPassword.js"></script>

<head>
    <title>Be Linked! Forgot password</title>
        <link rel="stylesheet" href="css/layout.css" type="text/css">
        <link rel="stylesheet" href="css/style.css" type="text/css">