Skip to main content

Posts

Showing posts with the label php

creating a facebook messaging system using php and facebook access tokens

Here is the procedure that was used to write posts in facebook by allowing the user to signin using their facebook id and then writing a post in their facebook profile page. 1. use the following url with your own application id created in facebook facebook login     Then after the page is reloading, get the access token returned by facebook for the logged in user     3. use the following lines of code to get the facebook access token from the set cookie above and use it to send the post data via curl to facebook if(isset($_COOKIE['access_token_fb'])) {     /* NEVER DELETE THIS LINE. THIS IS THE MOST IMPORTANT LINE IN USING FACEBOOK */     json_decode(file_get_contents('https://graph.facebook.com/me?access_token=' .$_COOKIE['access_token_fb']));         /* new testing code */         $url = "https://graph.facebook.com/me/feed";     $ch = curl_init();     $attachment =  array(   'access_token'  => $_COOKIE['access

PHP Programming

Here are few of the of the points that one has to learn about the php programming language Point / Topic / Trick Description / Detail isset to check if a variable is set and is not null; empty check if a variable is empty or not preg_replace Perform a regular expression search and replace urlencode to encode the url in a way that it can be used directly as the query part of the url htmlentities transforms the html tags or html characters to plain text i.e. < is replaced by < and > by > {..} in strings // inorder to use the php variables inside the query string, we have to use them within the curly braces like echo $feedUrl = "http://www.google.com/?q={$i}&option=search"; //during content rendering, the value is substituted instead of that variable $i. Technorati Tags: php , isset , keywords , tips , tricks , important points in php , must know in php