setValidData( (isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : null) ); } /** * Validate() - this method will determine if the current user agent matches the * user agent we stored when we initialized this variable. * * @return bool */ public function validate() { $current_browser = (isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : null); if ($current_browser === $this->getValidData()) { return true; } else { return false; } } }