<?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/"
	xmlns:series="http://unfoldingneurons.com/"
	>

<channel>
	<title>Programming Ideas, Logics, Tips and Tricks &#187; solution</title>
	<atom:link href="http://www.sajithmr.me/tag/solution/feed" rel="self" type="application/rss+xml" />
	<link>http://www.sajithmr.me</link>
	<description></description>
	<lastBuildDate>Sat, 07 Apr 2012 16:30:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Facebook Graph API for PHP</title>
		<link>http://www.sajithmr.me/facebook-graph-api-for-php</link>
		<comments>http://www.sajithmr.me/facebook-graph-api-for-php#comments</comments>
		<pubDate>Thu, 15 Jul 2010 05:29:09 +0000</pubDate>
		<dc:creator>Mr Me</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[apt-get]]></category>
		<category><![CDATA[blank page]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[install curl]]></category>
		<category><![CDATA[install json]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[pear]]></category>
		<category><![CDATA[pecl]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[sdk]]></category>
		<category><![CDATA[solution]]></category>

		<guid isPermaLink="false">http://www.sajithmr.me/?p=845</guid>
		<description><![CDATA[Like the old REST API, you don&#8217;t need to add 2-3 files for Facebook PHP SDK. The new graph api comes in a single file which is located at http://github.com/facebook/php-sdk/ Copy the facebook.php file in to your webroot and include this file in your php code. require_once(&#8216;facebook.php&#8217;); To work fully functional, you need CURL and [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-848" title="php" src="http://www.sajithmr.me/wp-content/uploads/2010/07/php.png" alt="php" width="346" height="226" /></p>
<p>Like the old REST API, you don&#8217;t need to add 2-3 files for Facebook PHP SDK. The new graph api comes in a single file which is located at <a href="http://github.com/facebook/php-sdk/" target="_blank">http://github.com/facebook/php-sdk/</a></p>
<p>Copy the facebook.php file in to your webroot and include this file in your php code.</p>
<p>require_once(&#8216;facebook.php&#8217;);</p>
<p>To work fully functional, you need CURL and JSON installed in your server. To check this use phpinfo() function.</p>
<p>To make sure, these missing is the main problem, add  <span style="color: #00ccff;"><span style="color: #3366ff;">exit(&#8216;Curl error&#8217;)</span>;</span> just above the line   <span style="color: #3366ff;">throw new Exception(&#8216;Facebook needs the CURL PHP extension.&#8217;); <span style="color: #000000;">in facebook.php file.</span></span></p>
<p><span style="color: #3366ff;"><span style="color: #000000;">Same for JSON.</span></span></p>
<p>The Linux way of installing CURL is :</p>
<p><strong>sudo apt-get install curl libcurl3 libcurl3-dev php5-curl</strong></p>
<p>To install JSON in your linux machine, follow <a href="http://slaptijack.com/system-administration/lets-install-json-for-php-5/" target="_blank">these</a> steps:</p>
<ol>
<li><strong>pecl install json</strong></li>
<li>Add json.ini file in /etc/php.d/</li>
<li>edit json.ini (in VI) and add this line: xtension=json.so</li>
<li>Save the file and restart appache (/etc/init.d/httpd restart)  <em>or apache2 restart depends on your linux OS</em></li>
</ol>
<p>See the example.php file in php-sdk from Github, if you call getSession function, you only get a NULL string if you are not logged in proper way. So I recommend to redirect into login page if there is no session available.</p>
<p>Here is the change:</p>
<p>if (! $facebook-&gt;getSession()) {</p>
<p>header(&#8216;Location: &#8216;.$facebook-&gt;getLoginUrl());</p>
<p>}</p>
<p>Then try the rest of the part as per example.php , it will work</p>
<p>Good Luck</p>
<p>Sajith</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sajithmr.me/facebook-graph-api-for-php/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Onchange, form submit &#8211; Error</title>
		<link>http://www.sajithmr.me/onchange-form-submit-error</link>
		<comments>http://www.sajithmr.me/onchange-form-submit-error#comments</comments>
		<pubDate>Mon, 09 Nov 2009 20:27:27 +0000</pubDate>
		<dc:creator>Mr Me</dc:creator>
				<category><![CDATA[html]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[form submit]]></category>
		<category><![CDATA[onchange]]></category>
		<category><![CDATA[solution]]></category>

		<guid isPermaLink="false">http://www.sajithmr.me/?p=480</guid>
		<description><![CDATA[If you are facing onchange and form submit of select-box (combo box) in html, you are not alone. In sometimes onchange = &#8220;document.formname.submit()&#8221; won&#8217;t submit the form, while it works on other html pages. There is hidden truth of this problem is , there may be some other input having the name &#8220;submit&#8221;. This cause [...]]]></description>
			<content:encoded><![CDATA[<p>If you are facing onchange and form submit of <strong>select-box</strong> (combo box) in html, you are not alone.</p>
<p>In sometimes onchange = &#8220;<span style="color: #008000;"><strong>document.formname.submit()</strong></span>&#8221; won&#8217;t submit the form, while it works on other html pages.</p>
<p>There is hidden truth of this problem is , there may be some other input having the name &#8220;submit&#8221;. This cause problem in IE and some other browsers. So rename the input field name from <strong>submit</strong> to any other name (In most case we use the name of submit button as &#8220;submit&#8221;).</p>
<p>It is a rare tip,  you may  face this someday !!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sajithmr.me/onchange-form-submit-error/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

