<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>An Lár &#187; php</title>
	<atom:link href="http://an-lar.com/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://an-lar.com</link>
	<description>Town center, We are in, We live in.</description>
	<lastBuildDate>Mon, 29 Jun 2009 19:43:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>development a &#8220;hello world&#8221;application with facebook api</title>
		<link>http://an-lar.com/2008/10/development-a-hello-worldapplication-with-facebook-api/</link>
		<comments>http://an-lar.com/2008/10/development-a-hello-worldapplication-with-facebook-api/#comments</comments>
		<pubDate>Wed, 29 Oct 2008 19:55:00 +0000</pubDate>
		<dc:creator>liduan</dc:creator>
				<category><![CDATA[Program]]></category>
		<category><![CDATA[Project]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[facebook API]]></category>
		<category><![CDATA[facebook apps]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://www.an-lar.com/2008/10/development-a-hello-worldapplication-with-facebook-api/</guid>
		<description><![CDATA[first of all, you need download facebook PHP Client Libraries. Extract package to you work path. open the directory, there are two sub-directory, PHP directory is libraries, you need use it to develop application. and a example directory called foodpoints. Open PHP directory, creating two PHP files &#8211; index.php and config.php.
In config.php:

&#60;?php
$api_key = &#039;[API_KEY]&#039;;&#38;amp;amp;nbsp; // [...]]]></description>
			<content:encoded><![CDATA[<p><big>first of all, you need download facebook <a href="http://svn.facebook.com/svnroot/platform/clients/packages/facebook-platform.tar.gz">PHP Client Libraries</a>. Extract package to you work path. open the directory, there are two sub-directory, PHP directory is libraries, you need use it to develop application. and a example directory called foodpoints. Open PHP directory, creating two PHP files &#8211; index.php and config.php.</big></p>
<p><big>In config.php:</big></p>
<pre class="brush: php">
&lt;?php
$api_key = &#039;[API_KEY]&#039;;&amp;amp;amp;nbsp; // your apps api key
$secret&amp;amp;amp;nbsp; = &#039;[SECRET_KEY]&#039;; // your apps secret key
$backurl=&quot;http://liduan.com/fb/start&quot;;&amp;amp;amp;nbsp; your call back web url
?&gt;
</pre>
<p><span id="more-58"></span><br />
In index.php:</p>
<pre class="brush: php">
&lt;?php
	include_once &#039;facebook.php&#039;;
	include_once &#039;config.php&#039;;

	$facebook = new Facebook($api_key, $secret);
	$facebook-&gt;require_frame();
	$user = $facebook-&gt;require_login(); // check user is login

	try{
	if(!$facebook-&gt;api_client-&gt;users_isAppAdded()){
		$facebook-&gt;redirect($facebook-&gt;get_add_url()); // check user is add this apps
		}

	}catch(Exception $ex){
		$facebook-&gt;set_user(null,null);
		$facebook-&gt;redirect($backurl);

	}

	// main
	echo &quot;&lt;p&gt;Hellow&lt;/p&gt;&quot;;
	echo &quot;&lt;p&gt;world&lt;/p&gt;&quot;;
	echo &quot;&lt;p&gt;this is developed by &lt;a href=&#039;http://liduan.com&#039;&gt;liduan.com&lt;/a&gt;&lt;/p&gt;&quot;;

	?&gt;
</pre>
<p><big>finish coding, upload whole php directory to web space that must support PHP5 and make sure public can access it. example http://liduan.com/fb/start </big></p>
<p><big>Next, adding apps to facebook, open http://developers.facebook.com, click &#8216;Get Start&#8217; -> &#8220;Add Facebook Developer Application&#8221; -> &#8220;Setup New Application&#8221; you will see a form of add new application. there are some very important options you must fill it. </big></p>
<p><big>
<ol>
<li><b>Application Name</b>: I remember this name can&#8217;t include &#8216;face&#8217; and &#8216;application&#8217;.</li>
<li><b>developer Contact email and user support email</b> is your and your partner email.</li>
<li><b>Callback URL: you can find it in config.php</b>. that&#8217;s you apps hosting address.</li>
<li><b>Canvas Page URL</b>: format is http://apps.facebook.com/[YOUR CANVAS PAGE URL]/ can not same with other apps, and not allow number.</li>
<li><b>Application Type</b> is Website.</li>
<li><b>Can your application be added on facebook?</b> if you choice &#8216;no&#8217;, that means nobody can find your apps in facebook apps list. </li>
<li><b>Post-Add URL is same with Canvas Page URL</b> : http://apps.facebook.com/[YOUR CANVAS PAGE URL]/</li>
<li><b>Default FBML</b>: you can fill &#8216;hello world&#8217;</li>
<li><b>Side Nav URL</b> is also same with <b>Canvas Page URL</b> : http://apps.facebook.com/[YOUR CANVAS PAGE URL]/</li>
</ol>
<p></big></p>
<p><big>submit form, you will find your api key and secret key. put them to you config.php and upload again. Now. open your call back url, and follow by facebook guide and add this app to your facebook account. you will see &#8220;hello world&#8221;.</big></p>



Share and Enjoy:


	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fan-lar.com%2F2008%2F10%2Fdevelopment-a-hello-worldapplication-with-facebook-api%2F&amp;partner=sociable" title="Print"><img src="http://anlar.duan.li/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fan-lar.com%2F2008%2F10%2Fdevelopment-a-hello-worldapplication-with-facebook-api%2F&amp;title=development%20a%20%22hello%20world%22application%20with%20facebook%20api&amp;bodytext=first%20of%20all%2C%20you%20need%20download%20facebook%20PHP%20Client%20Libraries.%20Extract%20package%20to%20you%20work%20path.%20open%20the%20directory%2C%20there%20are%20two%20sub-directory%2C%20PHP%20directory%20is%20libraries%2C%20you%20need%20use%20it%20to%20develop%20application.%20and%20a%20example%20directory%20called%20foodp" title="Digg"><img src="http://anlar.duan.li/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fan-lar.com%2F2008%2F10%2Fdevelopment-a-hello-worldapplication-with-facebook-api%2F" title="Sphinn"><img src="http://anlar.duan.li/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fan-lar.com%2F2008%2F10%2Fdevelopment-a-hello-worldapplication-with-facebook-api%2F&amp;title=development%20a%20%22hello%20world%22application%20with%20facebook%20api&amp;notes=first%20of%20all%2C%20you%20need%20download%20facebook%20PHP%20Client%20Libraries.%20Extract%20package%20to%20you%20work%20path.%20open%20the%20directory%2C%20there%20are%20two%20sub-directory%2C%20PHP%20directory%20is%20libraries%2C%20you%20need%20use%20it%20to%20develop%20application.%20and%20a%20example%20directory%20called%20foodp" title="del.icio.us"><img src="http://anlar.duan.li/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fan-lar.com%2F2008%2F10%2Fdevelopment-a-hello-worldapplication-with-facebook-api%2F&amp;t=development%20a%20%22hello%20world%22application%20with%20facebook%20api" title="Facebook"><img src="http://anlar.duan.li/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fan-lar.com%2F2008%2F10%2Fdevelopment-a-hello-worldapplication-with-facebook-api%2F&amp;title=development%20a%20%22hello%20world%22application%20with%20facebook%20api" title="Mixx"><img src="http://anlar.duan.li/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fan-lar.com%2F2008%2F10%2Fdevelopment-a-hello-worldapplication-with-facebook-api%2F&amp;title=development%20a%20%22hello%20world%22application%20with%20facebook%20api&amp;annotation=first%20of%20all%2C%20you%20need%20download%20facebook%20PHP%20Client%20Libraries.%20Extract%20package%20to%20you%20work%20path.%20open%20the%20directory%2C%20there%20are%20two%20sub-directory%2C%20PHP%20directory%20is%20libraries%2C%20you%20need%20use%20it%20to%20develop%20application.%20and%20a%20example%20directory%20called%20foodp" title="Google Bookmarks"><img src="http://anlar.duan.li/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=development%20a%20%22hello%20world%22application%20with%20facebook%20api&amp;body=http%3A%2F%2Fan-lar.com%2F2008%2F10%2Fdevelopment-a-hello-worldapplication-with-facebook-api%2F" title="email"><img src="http://anlar.duan.li/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://hellotxt.com/?status=development%20a%20%22hello%20world%22application%20with%20facebook%20api+http%3A%2F%2Fan-lar.com%2F2008%2F10%2Fdevelopment-a-hello-worldapplication-with-facebook-api%2F" title="HelloTxt"><img src="http://anlar.duan.li/wp-content/plugins/sociable/images/hellotxt.png" title="HelloTxt" alt="HelloTxt" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fan-lar.com%2F2008%2F10%2Fdevelopment-a-hello-worldapplication-with-facebook-api%2F&amp;title=development%20a%20%22hello%20world%22application%20with%20facebook%20api" title="Live"><img src="http://anlar.duan.li/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://myshare.url.com.tw/index.php?func=newurl&amp;url=http%3A%2F%2Fan-lar.com%2F2008%2F10%2Fdevelopment-a-hello-worldapplication-with-facebook-api%2F&amp;desc=development%20a%20%22hello%20world%22application%20with%20facebook%20api" title="MyShare"><img src="http://anlar.duan.li/wp-content/plugins/sociable/images/myshare.png" title="MyShare" alt="MyShare" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fan-lar.com%2F2008%2F10%2Fdevelopment-a-hello-worldapplication-with-facebook-api%2F&amp;t=development%20a%20%22hello%20world%22application%20with%20facebook%20api" title="MySpace"><img src="http://anlar.duan.li/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fan-lar.com%2F2008%2F10%2Fdevelopment-a-hello-worldapplication-with-facebook-api%2F&amp;t=development%20a%20%22hello%20world%22application%20with%20facebook%20api&amp;s=first%20of%20all%2C%20you%20need%20download%20facebook%20PHP%20Client%20Libraries.%20Extract%20package%20to%20you%20work%20path.%20open%20the%20directory%2C%20there%20are%20two%20sub-directory%2C%20PHP%20directory%20is%20libraries%2C%20you%20need%20use%20it%20to%20develop%20application.%20and%20a%20example%20directory%20called%20foodp" title="Tumblr"><img src="http://anlar.duan.li/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=development%20a%20%22hello%20world%22application%20with%20facebook%20api%20-%20http%3A%2F%2Fan-lar.com%2F2008%2F10%2Fdevelopment-a-hello-worldapplication-with-facebook-api%2F" title="Twitter"><img src="http://anlar.duan.li/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://bookmarks.yahoo.com/toolbar/savebm?u=http%3A%2F%2Fan-lar.com%2F2008%2F10%2Fdevelopment-a-hello-worldapplication-with-facebook-api%2F&amp;t=development%20a%20%22hello%20world%22application%20with%20facebook%20api&opener=bm&amp;ei=UTF-8&amp;d=first%20of%20all%2C%20you%20need%20download%20facebook%20PHP%20Client%20Libraries.%20Extract%20package%20to%20you%20work%20path.%20open%20the%20directory%2C%20there%20are%20two%20sub-directory%2C%20PHP%20directory%20is%20libraries%2C%20you%20need%20use%20it%20to%20develop%20application.%20and%20a%20example%20directory%20called%20foodp" title="Yahoo! Bookmarks"><img src="http://anlar.duan.li/wp-content/plugins/sociable/images/yahoomyweb.png" title="Yahoo! Bookmarks" alt="Yahoo! Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://yigg.de/neu?exturl=http%3A%2F%2Fan-lar.com%2F2008%2F10%2Fdevelopment-a-hello-worldapplication-with-facebook-api%2F&amp;exttitle=development%20a%20%22hello%20world%22application%20with%20facebook%20api" title="Yigg"><img src="http://anlar.duan.li/wp-content/plugins/sociable/images/yiggit.png" title="Yigg" alt="Yigg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="" title="BlogMemes Fr"><img src="http://anlar.duan.li/wp-content/plugins/sociable/images/" title="BlogMemes Fr" alt="BlogMemes Fr" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://cgi.fark.com/cgi/fark/farkit.pl?h=development%20a%20%22hello%20world%22application%20with%20facebook%20api&amp;u=http%3A%2F%2Fan-lar.com%2F2008%2F10%2Fdevelopment-a-hello-worldapplication-with-facebook-api%2F" title="Fark"><img src="http://anlar.duan.li/wp-content/plugins/sociable/images/fark.png" title="Fark" alt="Fark" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=development%20a%20%22hello%20world%22application%20with%20facebook%20api&amp;link=http%3A%2F%2Fan-lar.com%2F2008%2F10%2Fdevelopment-a-hello-worldapplication-with-facebook-api%2F" title="FriendFeed"><img src="http://anlar.duan.li/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.haohaoreport.com/submit.php?url=http%3A%2F%2Fan-lar.com%2F2008%2F10%2Fdevelopment-a-hello-worldapplication-with-facebook-api%2F&amp;title=development%20a%20%22hello%20world%22application%20with%20facebook%20api" title="Haohao"><img src="http://anlar.duan.li/wp-content/plugins/sociable/images/haohao.png" title="Haohao" alt="Haohao" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fan-lar.com%2F2008%2F10%2Fdevelopment-a-hello-worldapplication-with-facebook-api%2F&amp;title=development%20a%20%22hello%20world%22application%20with%20facebook%20api&amp;source=An+L%C3%A1r+Town+center%2C+We+are+in%2C+We+live+in.&amp;summary=first%20of%20all%2C%20you%20need%20download%20facebook%20PHP%20Client%20Libraries.%20Extract%20package%20to%20you%20work%20path.%20open%20the%20directory%2C%20there%20are%20two%20sub-directory%2C%20PHP%20directory%20is%20libraries%2C%20you%20need%20use%20it%20to%20develop%20application.%20and%20a%20example%20directory%20called%20foodp" title="LinkedIn"><img src="http://anlar.duan.li/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.mister-wong.com/addurl/?bm_url=http%3A%2F%2Fan-lar.com%2F2008%2F10%2Fdevelopment-a-hello-worldapplication-with-facebook-api%2F&amp;bm_description=development%20a%20%22hello%20world%22application%20with%20facebook%20api&amp;plugin=soc" title="MisterWong"><img src="http://anlar.duan.li/wp-content/plugins/sociable/images/misterwong.png" title="MisterWong" alt="MisterWong" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fan-lar.com%2F2008%2F10%2Fdevelopment-a-hello-worldapplication-with-facebook-api%2F&amp;partner=sociable" title="PDF"><img src="http://anlar.duan.li/wp-content/plugins/sociable/images/pdf.png" title="PDF" alt="PDF" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://ping.fm/ref/?link=http%3A%2F%2Fan-lar.com%2F2008%2F10%2Fdevelopment-a-hello-worldapplication-with-facebook-api%2F&amp;title=development%20a%20%22hello%20world%22application%20with%20facebook%20api&amp;body=first%20of%20all%2C%20you%20need%20download%20facebook%20PHP%20Client%20Libraries.%20Extract%20package%20to%20you%20work%20path.%20open%20the%20directory%2C%20there%20are%20two%20sub-directory%2C%20PHP%20directory%20is%20libraries%2C%20you%20need%20use%20it%20to%20develop%20application.%20and%20a%20example%20directory%20called%20foodp" title="Ping.fm"><img src="http://anlar.duan.li/wp-content/plugins/sociable/images/ping.png" title="Ping.fm" alt="Ping.fm" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://an-lar.com/feed/" title="RSS"><img src="http://anlar.duan.li/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://slashdot.org/bookmark.pl?title=development%20a%20%22hello%20world%22application%20with%20facebook%20api&amp;url=http%3A%2F%2Fan-lar.com%2F2008%2F10%2Fdevelopment-a-hello-worldapplication-with-facebook-api%2F" title="Slashdot"><img src="http://anlar.duan.li/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://socialogs.com/add_story.php?story_url=http%3A%2F%2Fan-lar.com%2F2008%2F10%2Fdevelopment-a-hello-worldapplication-with-facebook-api%2F&amp;story_title=development%20a%20%22hello%20world%22application%20with%20facebook%20api" title="Socialogs"><img src="http://anlar.duan.li/wp-content/plugins/sociable/images/socialogs.png" title="Socialogs" alt="Socialogs" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fan-lar.com%2F2008%2F10%2Fdevelopment-a-hello-worldapplication-with-facebook-api%2F" title="Technorati"><img src="http://anlar.duan.li/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://an-lar.com/2008/10/development-a-hello-worldapplication-with-facebook-api/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>
