Building functions.php
It is absolutely ok to call functions from other functions. There is nothing wrong with that. However, there's room for improvements in your code.

function.php:


There is no need to put simple expressions within parenthesis in your conditions.
The order of your conditions is irritating (negative, positive, negative, negative). Group them properly. That also helps to simplify the conditions.

function validate_registration($password, $confirmpassword, $email)
{
    if (empty($email) || empty($password) || empty($confirmpassword)) {
        registration_form();
        echo "Please enter the required information:";
    } elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
        registration_form();
        echo "You have not entered a valid email address!";
    }  elseif ($password !== $confirmpassword) {
        registration_form();
        echo "Your password does not match!";
    } else {
        input_registration($email, $password);
    }
}



input_registration:


Escape values on output using the right escaping function.  Since you use prepared statements, no extra escaping is needed for the database.
Create the database connection in central place, so you don't have to change several files and functions, if the database (or your password) changes.

function input_registration($db, $email, $password)
{
    $hash = md5($password); // Consider using a better hash algorithm
    $statement = $db-&gt;prepare("INSERT INTO userinfo(email, hash) VALUES (:email, :hash)");

    // Continue with inputting info into database
}



Of course you have to change validate_registration to support the injection of the database dependency.