select_db($global_survey_database) or die ("Unable to select database."); } //////////////////////////////////////////////// function connectx() //////////////////////////////////////////////// //used in process files in case of emergencies...:) { require_once("global_constants.php"); global $mysqli, $global_survey_database; $mysqli = mysqli_connect('p:localhost', "adminemr_newuser", "RaviIyer@745CommAve!") or die ("Unable to connect to database."); $db = $mysqli->select_db($global_survey_database) or die ("Unable to select database."); } //////////////////////////////////////////////// function checklogin() //////////////////////////////////////////////// { global $theparticipant, $_COOKIE, $_SERVER, $_SESSION, $_GET, $thetable, $qls; setparticipantid($qls->user_info['id']); if (empty($_SESSION['ORIG_REFER'])) { $_SESSION['ORIG_REFER'] = getenv("HTTP_REFERER"); } if (empty($_SESSION['ORIG_URL'])) { $_SESSION['ORIG_URL'] = getenv("REQUEST_URI"); } if (empty($_SESSION['GRAPH_GROUP']) and strlen($_GET['grp'])>2) { $_SESSION['GRAPH_GROUP'] = translategraphgroup($_GET['grp']); } } '146074459173049', 'app_secret' => '948fb4a07c128da88174e2e79aba1c1d', 'default_graph_version' => 'v2.8', 'cookie' => true ]); $helper = $fb->getRedirectLoginHelper(); $permissions = ['email,user_birthday,user_education_history,user_location,user_about_me,user_hometown,user_religion_politics,user_status,user_posts,user_likes']; // Optional permissions try { $accessToken = $helper->getAccessToken(); } catch(Facebook\Exceptions\FacebookResponseException $e) { // When Graph returns an error echo 'Graph returned an error: ' . $e->getMessage(); exit; } catch(Facebook\Exceptions\FacebookSDKException $e) { // When validation fails or other local issues // echo 'Facebook SDK returned an error: ' . $e->getMessage(); // exit; } if ($accessToken) { // Get User ID $response = $fb->get('/me?fields=id,name,email', $accessToken); $fbuser = $response->getGraphObject(); $fblogoutUrl = $helper->getLogoutUrl($accessToken, 'http://www.exploringmyreligion.org/logout.php'); } else { $fbloginUrl = $helper->getLoginUrl('http://www.exploringmyreligion.org/fblogin_process.php', $permissions); } } function cleantext($text) { $text = str_replace("'", "", $text); return $text; } ?> Exception: Call to undefined function connect_to_facebook()