function run() { $go = new ShortURL(); if( isset( $this->request['action'] ) ) { if( $this->request['action'] == 'add' ) { $go->print_results(); } elseif( $this->request['action'] == 'req' ) { $go->print_request_form(); } elseif( $this->request['action'] == 'email' ) { $go->send_email(); } } else { $go->print_form(); } //Since we connected to a different DB inside ShortURL, we need to //reconnect to Reason after we are done. connectDB( REASON_DB ); }