Pass parameter to an iframe embedded Fan Page in Facebook

Those who use their on hosting inside an iframe  for Facebook Fan page, there is a mechanism to pass additional parameters to your iframe page if you need to create a deep URL. A normal Fan page of Facebook would like this: https://www.facebook.com/apps/application.php?id=xxxxxxxxxx&sk=app_XXXXXX This Url will call your domain, say example.com inside the iframe to [...]

0 Comments

jRecorder 1.1 with Preview option is released

Two months ago, I published a jQuery plugin to record audio from browser (without any Media server) called jRecorder I got many responses and requests to maintain the code with new enhancements and some bug fixes. Based on that, a new version (1.1) is released which has the capability to preview the recorded audio before [...]

3 Comments

Facebook – Like to see the content

Sometime in Facebook Pages, you can see the message / banner, we have offers for you, like us to see. Or Like us to unlock the content etc. These all are for getting more likes in their Facebook page and indeed, it is a very nice idea to spread your updates among many of your [...]

4 Comments

jRecorder – jQuery plugin for audio recording

Recently I made a jQuery plugin named jRecorder to record voice in html pages. This plugin is very easy to integrate with your web page and you DON’T need a flash server or RED5 server to do the recording What all you need is a Web Server (PHP or any server scripting language). You can [...]

36 Comments

VARDUMP.IT – PHP remote debugging console

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 [...]

1 Comments , , , , ,

Algorithm for range of dates

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′); [...]

0 Comments , , , , , , , , , , , , , , , , , ,

Mysql Table Editor

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 [...]

3 Comments , , , , , , ,

XAJAX

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() {      [...]

0 Comments , , , , , , , ,

Contact Grabber

If you are a social media website developer , sometimes you might search for grabbing contacts from a particular email account if the password is given. I also did the same.  In most of the cases it did not work properly. But recently i got a contact grabber from phpclasses.org which works perfectly on Gmail, [...]

46 Comments , , , , , , , , , , , , , , , , , , , ,

Intelligent Watermark (php + gd)

Online Photoshop in PHP Part (5) >> (image after watermarked with gmail logo) Those who haven’t seen  the online photoshop tool created by me, just click here: http://www.sajithmr.com/photoshop Today we will implement the watermarking on images using php gd library. Intelligent watermarking means, apply a logo or a watermark image on another image by measuring [...]

3 Comments , , , , , , , ,

Crop Image Like Orkut

Online Photoshop in PHP (Series Part 4) >> Today we will discuss about cropping of images using php and gd library. Look at the simple example here: http://www.sajithmr.com/photoshop-tuts/crop/simplecrop.php $x1 = $_GET['x1']; $y1 = $_GET['y1']; $x2 = $_GET['x2']; $y2 = $_GET['y2']; $image_object = imagecreatefromjpeg(‘hari.jpg’); $image_cropped = Crop($image_object,$x1, $y1, $x2,$y2); $temp_path = rand(1,99999).”hari.jpg”; imagejpeg( $image_cropped,$temp_path); header(‘Location: simplecrop.php?img=’.$temp_path [...]

19 Comments , , , ,

Download Youtube Videos using PHP Code

  If you want to get the FLV file of any youtube video url using php code, here is the solution. If you are a PHP Programmer and if you are working with any video website, and if you need to grab videos (FLV files) from youtube and to put it yourown site (not object [...]

81 Comments , , , , , , , , ,

Online Photoshop in PHP (Series Part 3)

Resize a Photo >> Today we will implement hows to resize photo into a particular width and height (or keeping aspect ratio) See the live example from: http://www.sajithmr.com/photoshop-tuts/resize/resize.php You need to install php-gd library to do this. To functions, imagecreatetruecolor and imagecopyresampled will do the resizing. Those who have not seen the Online Photo Editing [...]

2 Comments , , ,

Online Photoshop in PHP (Series Part 2)

Implementation of the Browse Photos Area >> Today we will implement the browse photos area of online photoshop Those who haven’t seen the online photo editing tool, click on the above icon (baloon) You can see the browse area implementation here: http://www.sajithmr.com/photoshop-tuts/browse.php What you need for this is 4 php functions: is_dir , opendir, readdir, [...]

4 Comments , , , , ,

Online Photoshop in PHP (Series Part 1)

Introduction >> As i announced in my birthday post: celebrating-1st-year-of-sajithmr.com , i am starting my post series How to make Photoshop Express in PHP Before we starting the step by step procedure, have a look at : http://www.sajithmr.me/photoshop/index.php This is a basic version of online photo editing tool. You can either upload a photo to [...]

6 Comments , , , , , , , , , ,

PHP post without curl

You can simulate the post method using php without the help of curl library. download full source code: See the code below: function do_post_request($url, $data, $optional_headers = null) { $params = array(‘http’ =>; array(‘method’ =>; ‘POST’, ‘content’ =>; $data )); if ($optional_headers !== null) { $params['http']['header'] = $optional_headers; } $ctx = stream_context_create($params); $fp = @fopen($url, [...]

9 Comments , , , ,

OpenID Integration PHP

I think you know the use of OpenID. Else go here and learn http://en.wikipedia.org/wiki/OpenID http://openid.net/what/ http://openiddirectory.com/ In a nutshell, the OpenID technology makes life simpler by having only one username and password to remember – yahoo OpenID tour Here the php source code for integrating your site with OpenID. If you have a website which [...]

7 Comments , , , ,

Simple steps to create a wordpress theme

WordPress theme is merely a folder which is to be placed in wp-content folder of wordpress hierarchy . The basic files needed in that theme folder is index.php and style.css In this style.css the following lines are very essential. /* Theme Name: Theme Namet Theme URI: http://www.sajithmr.com/ Description: Details of your theme Author: Author name [...]

10 Comments , ,

PHP time ago calculation

The new web 2.0 displays time and date not in old style manner like 12.30 pm Jan 200 7. The new generation need relative time like 2 hours ago, 6 months ago, 4 years ago, very old etc. So if you save the timestamp of a particular content creation in database we can simply show [...]

19 Comments , , ,

PEAR – MIME Mail

When you send mail from php code, you use mail() function for this purpose. Here is another library from PEAR for sending MIME mails including html mails, attachments, inline picture attachment , plain text mail etc. The steps to install this library is : pear install http://download.pear.php.net/package/Mail_Mime-1.5.2.tgz pear install Mail (you need a pre-installed PEAR [...]

4 Comments ,

Upload Files Like Gmail

Now we can see ajax everywhere. Most of the famous websites are now enabled ajax for providing faster navigation and browsing speed. If you are a gmail user, the thing you noticed very attractively should be the file attaching part of the email composing window. If you wait for sometime you can see, your file [...]

23 Comments , ,

Trac Installation

Trac is an issue tracking system with wiki support. It also provide interface to subversion. It can be used as Web Subversion. Installation of trac > use apt-get install trac or yum install trac depends on your operating system. user this link for more installation help :http://trac.edgewall.org/wiki/TracDownload After the installation, you have to setup the [...]

2 Comments , , ,

Some More About Propel

Propel Random Criteria >> $c= new Criteria(); $c->addAscendingOrderByColumn(‘rand()’); $TagRs = TagPeer::doSelect($c ); ?> This code will give you the result in random manner. Here in this example, i show the random tags from Tag Table. Propel Memory Optimization using Result Set >> if you use $TagRs= TagPeer::doSelect(new Criteria()); The whole result of the query will [...]

2 Comments

Php exception handling

In normal desktop applications , we use exception handling everywhere in our code. But in server side script such as php, we can limit the usage of Exception handling. Example for raising an exception in php <?php //create function with an exception function checkValue($number) { if($number>4) throw new Exception(“Value must be 4 or below“); return [...]

2 Comments

Php decimal to Roman number Conversion

In many cases, we , php programmers need Roman number display I II III IV etc. Here is a simple algorithm for that . 1000, ‘CM’ => 900, ‘D’ => 500, ‘CD’ => 400, ‘C’ => 100, ‘XC’ => 90, ‘L’ => 50, ‘XL’ => 40, ‘X’ => 10, ‘IX’ => 9, ‘V’ => 5, [...]

11 Comments

Smpp library in php

Hello friends, If you have a smpp account you can simple send sms / unicode to any number using php. It is very simple . Sample code is: require_once(‘smppclass.php’); $smpphost = “203.199.142.41″; // your host address $smppport = 2345; $systemid = “idsfds”; // Your system id $password = “es223″; // Your smpp account password $system_type [...]

43 Comments

Amazon s3 example

Here i give you a sample code , in php, for amazon s3 file upload. Read the code carefully and try to implement. Best wishes. // grab this with “pear install Crypt_HMAC” require_once ‘HMAC.php’; // grab this with “pear install –onlyreqdeps HTTP_Request” require_once ‘Request.php’; // Note that version HTTP_Request 1.3.0 has a BUG in it! [...]

10 Comments ,

ffmpeg sample code

Install ffmpeg library in your server first. Place a video file of any type on current directory (or anywhere), here it is clock.avi . Click more for source code: extension_loaded(‘ffmpeg’) or die(‘Error in loading ffmpeg’); $ffmpegInstance = new ffmpeg_movie(‘clock.avi’); echo “getDuration: ” . $ffmpegInstance->getDuration() . “getFrameCount: ” . $ffmpegInstance->getFrameCount() . “getFrameRate: ” . $ffmpegInstance->getFrameRate() . [...]

95 Comments , , ,

Email Reading Library (Source Code)

With the support of component ezc , You can read your email via pop3 protocol. The email and password used here are only for temporary purpose. Try this code: Click more for source code: Share

7 Comments

PHP zipping algorithm

How can we zip two files and save output as output.zip. For example, in gmail you can download all the attachment as a single zip file. How can we write that code using php. Click more for Source Code: Share

7 Comments