/** * Connects to the DB using the _POST array * Also writes a config file upon a successful connect */ function connect() { $this->connector = new Connector($_POST[FORM_SERVER], $_POST[FORM_USER], $_POST[FORM_PASSWORD], $_POST[FORM_DATABASE]); $this->connector->connectDatabase(); if ($this->connector->success()) { $cfg = new ConfigFile(CONFIG_FILE_NAME); $cfg->generate(); return true; } echo "Couldn't connect to DB"; return false; }