<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: 5 Steps to publish on a facebook wall using php</title>
	<atom:link href="http://blog.theunical.com/facebook-integration/5-steps-to-publish-on-a-facebook-wall-using-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.theunical.com/facebook-integration/5-steps-to-publish-on-a-facebook-wall-using-php/</link>
	<description>TheUnical Technologies Official Blog</description>
	<lastBuildDate>Tue, 24 Jan 2012 22:20:48 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Mit</title>
		<link>http://blog.theunical.com/facebook-integration/5-steps-to-publish-on-a-facebook-wall-using-php/comment-page-5/#comment-11546</link>
		<dc:creator>Mit</dc:creator>
		<pubDate>Sat, 10 Dec 2011 12:19:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.theunical.com/?p=133429#comment-11546</guid>
		<description>Hi Steven 

 Mit Here again

i have to make post on my Facebook profile from my website and some how managed to make post getting login in to face book  but now i am facing problem is that if logout from Facebook my website login page cannot maintain my session .once i am logout it gives me message 

stdClass Object ( [error] =&gt; stdClass Object ( [message] =&gt; Error validating access token: Session has expired at unix time 1323518400. The current unix time is 1323519398. [type] =&gt; OAuthException ) ) 

even if again login from direclty from faceboo it shows me i am already logout 

Here is the path

http://clients.teamevolution.com.au/bym/mithun_facebook/index.php

we can also post a message from

after login

here is the code

===============================
$_SESSION[&#039;accesstoken&#039;], &#039;message&#039;=&gt;$_REQUEST[&#039;txt&#039;] );
		$url = &#039;https://graph.facebook.com/&#039;.$currentuser-&gt;facebookid.&#039;/feed&#039;;
		$ch = curl_init();
		curl_setopt_array($ch, array(
		CURLOPT_URL =&gt; $url,
		CURLOPT_POSTFIELDS =&gt; $params,
		CURLOPT_RETURNTRANSFER =&gt; true,
		CURLOPT_SSL_VERIFYPEER =&gt; false,
		CURLOPT_VERBOSE =&gt; true
		));
		$result = curl_exec($ch);
		curl_close($ch);
		echo &#039;Post successfully in Facebook.&#039;;
	}
	
		$curl = curl_init(&#039;https://graph.facebook.com/me?fields=id,name,bio&amp;access_token=&#039;.$_SESSION[&#039;accesstoken&#039;]);
		curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
		curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
		$result = curl_exec($curl);
		$fbuid = json_decode($result);
		print_r($fbuid);
		$user_id=$fbuid-&gt;id;
		if(is_null($user_id))
		{$_SESSION[&#039;live&#039;]=&quot;No&quot;;}
		else
		{$_SESSION[&#039;live&#039;]=&quot;YES&quot;;}
		

	echo &#039;Your name:&lt;b&gt;&#039;.$fbuid-&gt;name.&#039;&lt;/b&gt;&#039;;
	echo &#039;About you:&lt;b&gt;&#039;.$fbuid-&gt;bio.&#039;&lt;/b&gt;&#039;;
	echo &#039;Ur Profile link:&lt;a&gt;id.&#039;&quot; target=&quot;_blank&quot;&gt;Click here&lt;/a&gt;&#039;;
	echo &#039;Write something to post it in your Facebook wall&#039;;
	echo &#039;&#039;;
	echo &#039;&#039;;
	echo &#039;&#039;;
	echo &#039;&#039;;
	echo &#039;Submit&#039;;
	echo &#039;&#039;;
	echo &#039;&#039;;
	

}
elseif($_REQUEST[&#039;code&#039;])
{
	//getting access token from the retrieved code.
	// change $returnurl in the next line
	$returnurl = &quot;http://clients.teamevolution.com.au/bym/mithun_facebook/index.php&quot;;
	$url = &#039;https://graph.facebook.com/oauth/access_token?client_id=&#039;.$appid.&#039;&amp;redirect_uri=&#039;.$returnurl.&#039;&amp;client_secret=&#039;.$key.&#039;&amp;code=&#039;.$_REQUEST[&#039;code&#039;];
	$ch = curl_init();
	curl_setopt_array($ch, array(
	CURLOPT_URL =&gt; $url,
	CURLOPT_RETURNTRANSFER =&gt; true,
	CURLOPT_SSL_VERIFYPEER =&gt; false,
	CURLOPT_VERBOSE =&gt; true
	));
	$result = curl_exec($ch);
	curl_close($ch);
	$accesstoken = explode(&#039;&amp;&#039;, $result);
	$accesstoken = explode(&#039;=&#039;, $accesstoken[&#039;0&#039;]);
	//setting the accesstoken in a session to use it later.
	$_SESSION[&#039;accesstoken&#039;] = $accesstoken = $accesstoken[&#039;1&#039;];
	//following script to refresh the page after session is set
	echo &#039;window.location.reload();&#039;;
}
else
{
	$returnurl = &quot;http://clients.teamevolution.com.au/bym/mithun_facebook/index.php&quot;;
	$url = &quot;https://graph.facebook.com/oauth/authorize?&quot;;
	$url .= &quot;client_id=&quot;.$appid.&quot;&amp;&quot;;
	$url .= &quot;redirect_uri=&quot;.$returnurl.&quot;&amp;&quot;;
	$url .= &quot;scope=publish_stream,email,user_about_me&quot;;
	$url .= &quot;&amp;display=popup&quot;;
	echo &#039;&lt;a href=&quot;&#039;.$url.&#039;&quot; rel=&quot;nofollow&quot;&gt;Connect to Facebook&lt;/a&gt;&#039;;
	
}





?&gt;</description>
		<content:encoded><![CDATA[<p>Hi Steven </p>
<p> Mit Here again</p>
<p>i have to make post on my Facebook profile from my website and some how managed to make post getting login in to face book  but now i am facing problem is that if logout from Facebook my website login page cannot maintain my session .once i am logout it gives me message </p>
<p>stdClass Object ( [error] =&gt; stdClass Object ( [message] =&gt; Error validating access token: Session has expired at unix time 1323518400. The current unix time is 1323519398. [type] =&gt; OAuthException ) ) </p>
<p>even if again login from direclty from faceboo it shows me i am already logout </p>
<p>Here is the path</p>
<p><a href="http://clients.teamevolution.com.au/bym/mithun_facebook/index.php" rel="nofollow">http://clients.teamevolution.com.au/bym/mithun_facebook/index.php</a></p>
<p>we can also post a message from</p>
<p>after login</p>
<p>here is the code</p>
<p>===============================<br />
$_SESSION['accesstoken'], &#8216;message&#8217;=&gt;$_REQUEST['txt'] );<br />
		$url = &#8216;https://graph.facebook.com/&#8217;.$currentuser-&gt;facebookid.&#8217;/feed&#8217;;<br />
		$ch = curl_init();<br />
		curl_setopt_array($ch, array(<br />
		CURLOPT_URL =&gt; $url,<br />
		CURLOPT_POSTFIELDS =&gt; $params,<br />
		CURLOPT_RETURNTRANSFER =&gt; true,<br />
		CURLOPT_SSL_VERIFYPEER =&gt; false,<br />
		CURLOPT_VERBOSE =&gt; true<br />
		));<br />
		$result = curl_exec($ch);<br />
		curl_close($ch);<br />
		echo &#8216;Post successfully in Facebook.&#8217;;<br />
	}</p>
<p>		$curl = curl_init(&#8216;https://graph.facebook.com/me?fields=id,name,bio&amp;access_token=&#8217;.$_SESSION['accesstoken']);<br />
		curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);<br />
		curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);<br />
		$result = curl_exec($curl);<br />
		$fbuid = json_decode($result);<br />
		print_r($fbuid);<br />
		$user_id=$fbuid-&gt;id;<br />
		if(is_null($user_id))<br />
		{$_SESSION['live']=&#8221;No&#8221;;}<br />
		else<br />
		{$_SESSION['live']=&#8221;YES&#8221;;}</p>
<p>	echo &#8216;Your name:<b>&#8216;.$fbuid-&gt;name.&#8217;</b>&#8216;;<br />
	echo &#8216;About you:<b>&#8216;.$fbuid-&gt;bio.&#8217;</b>&#8216;;<br />
	echo &#8216;Ur Profile link:<a>id.&#8217;&#8221; target=&#8221;_blank&#8221;&gt;Click here</a>&#8216;;<br />
	echo &#8216;Write something to post it in your Facebook wall&#8217;;<br />
	echo &#8221;;<br />
	echo &#8221;;<br />
	echo &#8221;;<br />
	echo &#8221;;<br />
	echo &#8216;Submit&#8217;;<br />
	echo &#8221;;<br />
	echo &#8221;;</p>
<p>}<br />
elseif($_REQUEST['code'])<br />
{<br />
	//getting access token from the retrieved code.<br />
	// change $returnurl in the next line<br />
	$returnurl = &#8220;http://clients.teamevolution.com.au/bym/mithun_facebook/index.php&#8221;;<br />
	$url = &#8216;https://graph.facebook.com/oauth/access_token?client_id=&#8217;.$appid.&#8217;&amp;redirect_uri=&#8217;.$returnurl.&#8217;&amp;client_secret=&#8217;.$key.&#8217;&amp;code=&#8217;.$_REQUEST['code'];<br />
	$ch = curl_init();<br />
	curl_setopt_array($ch, array(<br />
	CURLOPT_URL =&gt; $url,<br />
	CURLOPT_RETURNTRANSFER =&gt; true,<br />
	CURLOPT_SSL_VERIFYPEER =&gt; false,<br />
	CURLOPT_VERBOSE =&gt; true<br />
	));<br />
	$result = curl_exec($ch);<br />
	curl_close($ch);<br />
	$accesstoken = explode(&#8216;&amp;&#8217;, $result);<br />
	$accesstoken = explode(&#8216;=&#8217;, $accesstoken['0']);<br />
	//setting the accesstoken in a session to use it later.<br />
	$_SESSION['accesstoken'] = $accesstoken = $accesstoken['1'];<br />
	//following script to refresh the page after session is set<br />
	echo &#8216;window.location.reload();&#8217;;<br />
}<br />
else<br />
{<br />
	$returnurl = &#8220;http://clients.teamevolution.com.au/bym/mithun_facebook/index.php&#8221;;<br />
	$url = &#8220;https://graph.facebook.com/oauth/authorize?&#8221;;<br />
	$url .= &#8220;client_id=&#8221;.$appid.&#8221;&amp;&#8221;;<br />
	$url .= &#8220;redirect_uri=&#8221;.$returnurl.&#8221;&amp;&#8221;;<br />
	$url .= &#8220;scope=publish_stream,email,user_about_me&#8221;;<br />
	$url .= &#8220;&amp;display=popup&#8221;;<br />
	echo &#8216;<a href="'.$url.'" rel="nofollow">Connect to Facebook</a>&#8216;;</p>
<p>}</p>
<p>?&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vikash Sharma</title>
		<link>http://blog.theunical.com/facebook-integration/5-steps-to-publish-on-a-facebook-wall-using-php/comment-page-5/#comment-11226</link>
		<dc:creator>Vikash Sharma</dc:creator>
		<pubDate>Thu, 29 Sep 2011 12:36:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.theunical.com/?p=133429#comment-11226</guid>
		<description>Hi Steven,

Thanks for such a great post. We are also doing the same task for one of our website. We are able to fetch the User details as well as User&#039;s Friend List. User&#039;s friend list means the details of friends and relatives, whom user has added in his Facebook account.

But we are facing problems In:
1. Getting the email Id and Mobile number of User&#039;s Friend.
2. Posting a dynamic message on the wall of multiple friend&#039;s (User&#039;s Friend). We do not have the email id of the friends but we have a unique Facebook id of all these friends of the user. We want to post a message on friend&#039;s wall using the same id.

The functionality is like given below:

User will login to our website and will select multiple friends/relatives from his friend list that we had fetched from Facebook. Then he will write a message for all his selected friends.
When he will click on submit button, we want to post a message like,  has sent a message to  to invite him to meet at . Please click the link  to view more details about the user.

This message should post on the wall of all the selected friends. We have  and  stored in database.</description>
		<content:encoded><![CDATA[<p>Hi Steven,</p>
<p>Thanks for such a great post. We are also doing the same task for one of our website. We are able to fetch the User details as well as User&#8217;s Friend List. User&#8217;s friend list means the details of friends and relatives, whom user has added in his Facebook account.</p>
<p>But we are facing problems In:<br />
1. Getting the email Id and Mobile number of User&#8217;s Friend.<br />
2. Posting a dynamic message on the wall of multiple friend&#8217;s (User&#8217;s Friend). We do not have the email id of the friends but we have a unique Facebook id of all these friends of the user. We want to post a message on friend&#8217;s wall using the same id.</p>
<p>The functionality is like given below:</p>
<p>User will login to our website and will select multiple friends/relatives from his friend list that we had fetched from Facebook. Then he will write a message for all his selected friends.<br />
When he will click on submit button, we want to post a message like,  has sent a message to  to invite him to meet at . Please click the link  to view more details about the user.</p>
<p>This message should post on the wall of all the selected friends. We have  and  stored in database.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven Wall</title>
		<link>http://blog.theunical.com/facebook-integration/5-steps-to-publish-on-a-facebook-wall-using-php/comment-page-5/#comment-11214</link>
		<dc:creator>Steven Wall</dc:creator>
		<pubDate>Tue, 27 Sep 2011 03:04:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.theunical.com/?p=133429#comment-11214</guid>
		<description>@Mit are u trying from ur local machine? Try from a public IP</description>
		<content:encoded><![CDATA[<p>@Mit are u trying from ur local machine? Try from a public IP</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mithun</title>
		<link>http://blog.theunical.com/facebook-integration/5-steps-to-publish-on-a-facebook-wall-using-php/comment-page-5/#comment-11210</link>
		<dc:creator>Mithun</dc:creator>
		<pubDate>Mon, 26 Sep 2011 09:28:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.theunical.com/?p=133429#comment-11210</guid>
		<description>Hi steven 

I want to post on facebook wall from my website i have also code which i have downloaded from http://blog.theunical.com/wp-content/uploads/2010/01/fb_app.zip

but after applying 
facebook_api_key, facebook_api_secret and testtoken as access token  i am still getting the  following errors

Fatal error: Uncaught exception &#039;FacebookRestClientException&#039; with message &#039;The parameter auth_token is required&#039; in E:\DEV4.HCS\testingcode\facebook_wall\facebook-platform\php\facebookapi_php5_restlib.php:3025 Stack trace: #0 E:\DEV4.HCS\testingcode\facebook_wall\facebook-platform\php\facebookapi_php5_restlib.php(300): FacebookRestClient-&gt;call_method(&#039;facebook.auth.g...&#039;, Array) #1 E:\DEV4.HCS\testingcode\facebook_wall\index.php(6): FacebookRestClient-&gt;auth_getSession(NULL) #2 {main} thrown in E:\DEV4.HCS\testingcode\facebook_wall\facebook-platform\php\facebookapi_php5_restlib.php on line 3025 

can i have solution for this 

thank you very much for providing such helping platform.

thanks again 
mit</description>
		<content:encoded><![CDATA[<p>Hi steven </p>
<p>I want to post on facebook wall from my website i have also code which i have downloaded from <a href="http://blog.theunical.com/wp-content/uploads/2010/01/fb_app.zip" rel="nofollow">http://blog.theunical.com/wp-content/uploads/2010/01/fb_app.zip</a></p>
<p>but after applying<br />
facebook_api_key, facebook_api_secret and testtoken as access token  i am still getting the  following errors</p>
<p>Fatal error: Uncaught exception &#8216;FacebookRestClientException&#8217; with message &#8216;The parameter auth_token is required&#8217; in E:\DEV4.HCS\testingcode\facebook_wall\facebook-platform\php\facebookapi_php5_restlib.php:3025 Stack trace: #0 E:\DEV4.HCS\testingcode\facebook_wall\facebook-platform\php\facebookapi_php5_restlib.php(300): FacebookRestClient-&gt;call_method(&#8216;facebook.auth.g&#8230;&#8217;, Array) #1 E:\DEV4.HCS\testingcode\facebook_wall\index.php(6): FacebookRestClient-&gt;auth_getSession(NULL) #2 {main} thrown in E:\DEV4.HCS\testingcode\facebook_wall\facebook-platform\php\facebookapi_php5_restlib.php on line 3025 </p>
<p>can i have solution for this </p>
<p>thank you very much for providing such helping platform.</p>
<p>thanks again<br />
mit</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven Wall</title>
		<link>http://blog.theunical.com/facebook-integration/5-steps-to-publish-on-a-facebook-wall-using-php/comment-page-5/#comment-11188</link>
		<dc:creator>Steven Wall</dc:creator>
		<pubDate>Thu, 22 Sep 2011 03:01:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.theunical.com/?p=133429#comment-11188</guid>
		<description>@sanjay Your friends should be able to see it , did u changed any settings on ur FB? To publish on their walls they need to give permission.</description>
		<content:encoded><![CDATA[<p>@sanjay Your friends should be able to see it , did u changed any settings on ur FB? To publish on their walls they need to give permission.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sanjay</title>
		<link>http://blog.theunical.com/facebook-integration/5-steps-to-publish-on-a-facebook-wall-using-php/comment-page-5/#comment-11175</link>
		<dc:creator>sanjay</dc:creator>
		<pubDate>Wed, 21 Sep 2011 04:25:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.theunical.com/?p=133429#comment-11175</guid>
		<description>HI Steven ,
I have created a new application on FB.I can access it from new Tab ,but my friends or anyone on FB cannot access it...They cannot get it.I have to publish or submit my newly created Apps?</description>
		<content:encoded><![CDATA[<p>HI Steven ,<br />
I have created a new application on FB.I can access it from new Tab ,but my friends or anyone on FB cannot access it&#8230;They cannot get it.I have to publish or submit my newly created Apps?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven Wall</title>
		<link>http://blog.theunical.com/facebook-integration/5-steps-to-publish-on-a-facebook-wall-using-php/comment-page-5/#comment-11115</link>
		<dc:creator>Steven Wall</dc:creator>
		<pubDate>Sun, 11 Sep 2011 05:33:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.theunical.com/?p=133429#comment-11115</guid>
		<description>@arron, Its better if you host on a public domain , not localhost.</description>
		<content:encoded><![CDATA[<p>@arron, Its better if you host on a public domain , not localhost.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: aaron</title>
		<link>http://blog.theunical.com/facebook-integration/5-steps-to-publish-on-a-facebook-wall-using-php/comment-page-5/#comment-11108</link>
		<dc:creator>aaron</dc:creator>
		<pubDate>Fri, 09 Sep 2011 14:31:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.theunical.com/?p=133429#comment-11108</guid>
		<description>steven , if i put my URL in my app as &quot;http://127.0.0.1/index.php&quot; , can it work? because my website is localhost</description>
		<content:encoded><![CDATA[<p>steven , if i put my URL in my app as &#8220;http://127.0.0.1/index.php&#8221; , can it work? because my website is localhost</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven Wall</title>
		<link>http://blog.theunical.com/facebook-integration/5-steps-to-publish-on-a-facebook-wall-using-php/comment-page-5/#comment-10990</link>
		<dc:creator>Steven Wall</dc:creator>
		<pubDate>Fri, 26 Aug 2011 03:03:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.theunical.com/?p=133429#comment-10990</guid>
		<description>Yes you can save that to a .php file</description>
		<content:encoded><![CDATA[<p>Yes you can save that to a .php file</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Novrizal</title>
		<link>http://blog.theunical.com/facebook-integration/5-steps-to-publish-on-a-facebook-wall-using-php/comment-page-5/#comment-10989</link>
		<dc:creator>Novrizal</dc:creator>
		<pubDate>Thu, 25 Aug 2011 22:43:36 +0000</pubDate>
		<guid isPermaLink="false">http://blog.theunical.com/?p=133429#comment-10989</guid>
		<description>I dont understand on steps 3
After i make a php script on step 3.
Then, what must i do with this script ?
Save ? other name xxxx.php ?</description>
		<content:encoded><![CDATA[<p>I dont understand on steps 3<br />
After i make a php script on step 3.<br />
Then, what must i do with this script ?<br />
Save ? other name xxxx.php ?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

