checkUser($name, $password); if($check){ $this->regUser(); } else { header("Location:/count_form.php/?p=login"); } } } function createUser() { $this->name = 'form_admin'; $this->password = 'qwerty'; } function checkUser($name, $password) { $this->createUser(); if($this->name = $name){ if($this->password = $password) { return true; } else { return false; } } else { return false; } } function regUser(){ if(session_id()){ $_SESSION['form_admin'] = true; } else { session_start(); $_SESSION['form_admin'] = true; } } }