Facebook Graph API – The missing part
Posted by Sajith M.R in general on 15. Jul, 2010 | 0 Comments
As you all know recent changes in privacy issues made Facebook to change their basic API and added some security concerns. From my best practise, most of the old applications are safe, but you will be in trouble when you create new application. By default you cannot access user’s photos, profile pictures , albums etc. [...]
Facebook Graph API for PHP
Posted by Sajith M.R in general on 15. Jul, 2010 | 0 Comments
Like the old REST API, you don’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(’facebook.php’);
To work fully functional, you need CURL and JSON installed in [...]
PHP Session problem with cloud server
Posted by Sajith M.R in php on 08. Jul, 2010 | 0 Comments
There is a very strange issue with PHP session when you prefer session to save in files other than database (normal session).
The problem is: some times you can access all the saved session values from $_SESSION and sometimes it returns a empty array.
If you refresh 10 times, perhaps 4 times you will get session and [...]
VARDUMP.IT – PHP remote debugging console
Posted by Sajith M.R in php, php source code, webworld on 11. Jun, 2010 | 1 Comment
In PHP coding, we spend most of the time for debugging. Either we use echo, print_r or var_dump to check variable values or check whether a particular function is executing or not.
These all things are outputting something to browser. This is not applicable in case of redirection, or image processing (GD) or sometimes with callback [...]
Multi-language support with PHP
Posted by Sajith M.R in general, php on 06. Jun, 2010 | 1 Comment
If you aim to create a multi-language website using PHP + Mysql , remember the following tips.
You can use mysql database for this purpose rather than using separate language files as usual content management system does.
You can create a table with following structure for this purpose.Table: muli-lang
string_id:
page_id:
en:
arb:
fr:
Here string_id is the code for getting content [...]
Algorithm for range of dates
Posted by Sajith M.R in php, php source code on 12. May, 2010 | 0 Comments
Here is a php function which returns from and to date as an array for a range:
<?php
function get_rangeof_dates($time_frame = ‘all_time’)
{
$from_date = ”;
$to_date = ”;
switch($time_frame)
{
case ‘all_time’: $from_date = ‘1170-01-01 00:00:00′;
$to_date = ‘2250-12-31 23:59:59′;
break;
case ‘today’:
$from_date = date(‘Y-m-d 00:00:00′);
$to_date = date(‘Y-m-d 23:59:59′);
break;
[...]
Facebook application development – Quick note
Posted by Sajith M.R in php on 06. May, 2010 | 0 Comments
This is a quick note for myself to remember some tricks while we develop a Facebook application.
If you are a beginner in Facebook application development, go here first.
If you an expert in Facebook development, go here.
The steps in creating a facebook app.
1) Register an application in facebook
2) Add Canvas URL
3) Add Canvas Callback [...]
PHP Spider – Sphider
Posted by Sajith M.R in php on 01. May, 2010 | 0 Comments
We can create a search page for a dynamic website using Database queries and looping over resultant record sets. But what can we do if the website main contains static html files than dynamically populated content. In this case , we usually put Google search box inside website (Google custom search)
Sphider is a php based [...]
Firephp
Posted by Sajith M.R in php on 18. Aug, 2009 | 2 Comments
We like firebug , We like PHP , if so, We also begin to like FirePHP !!!
Using firephp , you can debug your php code. Firephp is a firefox plugin which works on firebug console.
In our php life, we know we can use echo function to print or debug the value of a variable and [...]
Mysql Table Editor
Posted by Sajith M.R in php, php source code on 04. Jun, 2009 | 3 Comments
In a php project, if we get the requirement , we usually start design and database. But the data entry procedure is very hard. In this case PhpMyadmin is a good comfort.
Here is another tool from phpguru.org , MySQL Table Editor. Using this library you can make your database table editable from your php code.
You [...]
XAJAX
Posted by Sajith M.R in php, php source code on 03. Jun, 2009 | 0 Comments
Basically using xajax “You can directly call php functions from your javascript code”
Xajax will do the rest.
For example, if you are going to write a javascript function Capitalize which captilaze your textbox content when you press a button.
Here is the pure html/javascript code for that:
=============================================
<script>
function Capitalize()
{
var t = document.getElementById(’cap’).value;
document.getElementById(’update’).innerHTML [...]
Symfony V/S Codeigniter
Posted by Sajith M.R in php, webworld on 02. Jun, 2009 | 8 Comments
V/S
I have developed more than 7 web projects using Symfony framework. Mobshare.in, Amvizone.com, Campaignmanger.in , Movieonline.in etc are some of the websites. But for the past 5 months my developement is in Codeigniter. It is very very lighter than Symfony and has almost all the features of Symfony. Both are MVC [...]



