Tutorial to create facebook application using codeigniter php framework.
![]()
![]()
link to download
download from github
Step 1:Set the facebook application key and secret key to facebook.php file in appln/config folder
<?php $config['facebook_app_id'] = 'your app_id'; $config['facebook_api_secret']='your app secret id'; $config['facebook_default_scope']='email,user_birthday,user_location,photo_upload, user_photos,user_photo_video_tags,user_work_history,user_about_me,user_hometown'; $config['facebook_api_url'] = 'https://graph.facebook.com/'; // Just in case it changes. </php>
Step 2:Load the facebook library file to your function
$this->load->config('facebook'); $this->_api_url = $this->config->item('facebook_api_url'); $this->_api_key = $this->config->item('facebook_app_id'); $this->_api_secret = $this->config->item('facebook_api_secret'); $this->_default_scope = $this->config->item('facebook_default_scope'); $config = array( 'appId' => $this->_api_key, 'secret' => $this->_api_secret, 'fileUpload' => true, // Indicates if the CURL based @ syntax for file uploads is enabled. ); $this->load->library('Facebook', $config);//load facebook library for facebook sdk
after the above two steps we can call the function to get and access the facebook api
To get the facebook user id
function get_user(){//return the facebook user id return $this->_user=$this->facebook->getUser(); }
To get facebook login url
function get_login_url(){//return the facebook login url. like to change the scope of loginUrl(config/facebook.php) return $this->facebook->getLoginUrl( array( 'scope' => $this->_default_scope ) ); }
To get the facebook logout url
function get_logout_url(){//return the facebook logoutUrl return $this->facebook->getLogoutUrl(); }




Hey,
I couldn’t download the file. Can you repost it?
right click and save link to download
I have got this error, when i used this code. Fatal error: Call to a member fuintcon api() on a non-object in /application/libraries/fb_connect.php on line 56 Anyone can help me to resolve this error.
der WebInOne Blog gibt es einen Beitrag fcber das Tun einiger Datum Validierung in CodeIgniter 2 Formulare mit dem set_validation -Methode. Ich scherib ein Tutorial hier fcber die
Hi,Im trying to inmlemept Your tutorial, and as far as first part everything works But i don’t understand one thing in second part (posting to wall) We have variable $this->fbSession in fb_connect.php controller but its defined as FALSE, and nowhere changed so it is still FALSE So the post_to_wall function will always return FALSE Can You point me where i’m wrong or what is missing?Try, and Keep Up Good Work
I couldn’t download the file. Can you send it ? (fbdsk.raz 4,7 KO)