I wrote this class for the project I'm currently working on. It's basically used to change a user's password. I'd like to know your thoughts on the basic structure/design of this class and how it can be improved, or if you'd have written it differently.class Recover_password{    //class by sami    private $conn;    private $password_one;    private $password_two;    function initialize_connection($conn){        if($conn instanceof PDO){            $this->conn = $conn;        }else{            echo Connection problem accured;        }    }    function is_posted(){        if(isset($_POST[change_password])){            $this->is_empty();        }else{            echo nothing's being posted!;        }    }    private function is_empty(){        foreach($_POST as $post_value){            if(!empty($post_value)){                $is_empty = false;            }else{                echo Field/s are empty;                break;            }        }        if(isset($is_empty)){            $this->set_values();        }    }    private function set_values(){        $this->password_one = strip_tags(stripslashes(trim($_POST[password_two], '')));        $this->password_two = strip_tags(stripslashes(trim($_POST[password_one], '')));        if($this->password_one == $this->password_two){            if( (strlen($this->password_one) > 10) or (strlen($this->password_two) > 10) ){                $this->password_one = md5($this->password_one);                $this->change_password_to_new();            }else{                $this->show_message(The password you provided is too weak);            }        }else{            $this->show_message(Please make sure the passwords match);        }    }    private function change_password_to_new(){        $insert_pass_query = $this->conn->prepare(update registered_users set user_password = :user_password where username = :username);        if( $insert_pass_query->execute(array('user_password'=>$this->password_one, 'username'=>$_SESSION[logged_in])) ){            $this->show_message(Password has been sucessfully changed!);          }else{            $this->show_message(Unknown error occured, please contact admin.);        }    }    private function show_message($message){        $_SESSION[message] = $message;        header(location: show_message.php);    }}
Changing a user's password
php;classes