function form_process()
{
    global $to, $subject;
    $errors = validate_form_items();
    if (count($errors) == 0) {
        $errors[] = email(trim($_POST["email"]), $to, $subject, $_POST["message"]);
    }
    print_error($errors);
}
function form_process()
{
    $from_name = $_POST["your_name"];
    $from_email = $_POST["your_email"];
    $to = $_POST["your_email"] . "," . $_POST["friend_email1"] . "," . $_POST["friend_email2"] . "," . $_POST["friend_email3"];
    $message = $_POST["message"];
    $error_count = validate_form_items();
    if ($error_count == 0) {
        if (email($from_email, $from_name, $to, $message)) {
            header("Location: thankyou.html");
        } else {
            global $errors;
            $errors[] = "Email coudn't be send at this time. <br>Please report the webmaster of this error.";
        }
    }
}