Recursive Function for Nested Categories

Nested Categories over Drop Down

Nested Categories

Categories and its sub categories are always useful while developing simple to huge applications. Here is a simple php code to create multi-leveled nested categories on select box to those categories.

CREATE TABLE `tb_category` (
`pid` int(11) NOT NULL,
`name` varchar(255) NOT NULL



Function lists all items in table tb_category

- id

- pid

- name








function RecursiveCat($pid)


static $level=0;

static $strid="";

static $strname="";

$sql=mysql_query("select * from tb_category where pid = '$pid' order by name ");






for($p=1;$p<($level*-1);$p++) $pad.="&nbsp;&nbsp;&nbsp;- ";

$strname.='<option value="'.$row['id'].'">'.$pad.$row['name'].'</option>';





return $strname;


echo '<select name="cat">';

echo RecursiveCat(0);

echo '</select>';


SIP Web Phone

SIP Phone service which lets you use your SIP account anywhere in the world via their web based SIP service. The good thing is they already have a few popular SIP services pre-configured, so you don’t even have to configure their SIP.

SIP (Session Initiation Protocol) is the most popular Voice over IP (VoIP) standard. SIP enables two or more people to make phone calls to each other using the Internet to carry the call.

A good quality sip provider will allow for pristine call quality and minimal drops.

Using Flex, Java and Red5 Server we can develop Web Sip Application. The main advantage of these phone is no need to install at client side. Simply we can browse application and we can register and make call.

Asterisk. Digium’s open source communications engine powers voice and video communication solutions worldwide. Discover the power of Asterisk, let us help you choose the right Asterisk solution.

Click2Call is a service that provides users of your websites to make calls from your website and leave voicemails for you by simply clicking a button.

Free Call - Free International Calls & Free VoIP Service. Internet phone calls - free VoIP, call PC to phone over Internet telephony

TringMe also provides a complete ecosystem wherein VoIP providers, Service providers, Enterprises, Developers and End-users can play. An ecosystem which can cater to developing innovative applications that integrate Voice and Telephony without worrying about the underlying details of call routing and signalling.

TringMe - Web based Telephony

Twilio Voice
Build applications that use the phone network to interact with people on landlines and cell phones all over the world. In just a few lines of code, you’ll have phones ringing.

Twilio - Build Scalable Voice, VoIP and SMS Applications in the Cloud


Build voice enabled applications directly in PHP.

VoicePHP - PHP For Voice

Doddle Web Phone

Online SIP WebPhone-Click2Call Doddle - VoIP call from webpage public telephone

Make VoIP calls anywhere in the world via Doddle web based SIP phone directly from your webpage.
Public Internet Telephone: With the free, online, no registration Doddle phone service, VoIP is as easy as accessing a webpage: just start using!
It’s a Doddle.

Linphone is an internet phone or Voice Over IP phone (VoIP).

Linphone, open-source voip software - Linphone, an open-source video sip phone

* Linphone can be used for communicating freely with people over the internet, with voice, video, and text instant messaging.
* Linphone makes use of the SIP protocol , an open standard for internet telephony. You can use Linphone with any SIP VoIP operator, including our free SIP audio/video service.
* Linphone is free-software (or open-source), you can download and redistribute it freely.
* Linphone is available for desktop computers: Linux, Windows, MacOSX, and for mobile phones: Android, iPhone, Blackberry.

OpenSIPS (Open SIP Server) is a mature Open Source implementation of a SIP server. OpenSIPS is more than a SIP proxy/router as it includes application-level functionalities. OpenSIPS, as a SIP server, is the core component of any SIP-based VoIP solution. With a very flexible and customizable routing engine, OpenSIPS ‘unifies voice, video, IM and presence services in a highly efficient way, thanks to its scalable (modular) design.

OpenSIPS feature:
* SIP registrar server
* SIP router / proxy (lcr, dynamic routing, dialplan features)
* SIP redirect server
* SIP presence agent
* SIP back-to-back User Agent
* SIP IM server (chat and end-2-end IM)
* SIP to SMS gateway (bidirectional)
* SIP to XMPP gateway for presence and IM (bidirectional)
* SIP load-balancer or dispatcher
* SIP front end for gateways/asterisk
* SIP NAT traversal unit
* SIP application server

Cipango is a SIP Servlets extension to the popular Jetty HTTP Servlet engine. Cipango/Jetty is then a convergent SIP/HTTP Application Server compliant with both SIP Servlets 1.1 and HTTP Servlets 2.5 standards. It also features a Diameter extension to develop IMS applications.


OpenVBX allows developers to build voice and SMS applications for business, such as toll free phone numbers, call forwarding, voicemail, visual voicemail, voicemail transcriptions, and auto-attendants. It’s like Google Voice, but open source and for business.

OpenVBX- the Web-based, Open Source Phone System for Business

OpenVBX- the Web-based, Open Source Phone System for Business1

FreeSWITCH is a scalable open source cross-platform telephony platform designed to route and interconnect popular communication protocols using audio, video, text or any other form of media. FreeSWITCH also provides a stable telephony platform on which many telephony applications can be developed using a wide range of free tools.

Record Audio from Websites

Flex is a platform for developing and deploying Applications that run on Flash player on Web using Red5 Server.

Flex / Red5 applications are compiled to SWF files and are executed at runtime by Adobe Flash Player.


Open source Red5 video flex flash recorder and player project allows you to insert a red5 / flex module to do it directly from your website. Uses Flex and red5. Videos are stored as FLV streams and can be playable and reviewed from this project within flash player. 2 modes are visible: recorder mode and player mode. All other parameters can be defined through simple html script.

Record, Visualize & Save Microphone Input

Record, Visualize & Save Microphone Input - makemachine

MicrophoneCapture, MicrophoneInput, InputRenderer, WavEncoder are some basic classes to record audio from microphone.

Create a Useful Audio Recorder App in ActionScript

Create a Useful Audio Recorder App in ActionScript 3 - Activetuts+

The MicRecorder class is a great addition to ActionScript 3, be sure to bookmark this article. 😉

Barebones Audio Recorder

Client-side audio capture and conversion to MP3.

This recorder captures user audio, converts to MP3 format on the client side, then uploads to the server.

Barebones Audio Recorder

Flash-based interface
Barebones Audio Recorder1

Sample HTML-based interface
Barebones Audio Recorder2

Red5 record audio with the Flash plugin

Other Links:

PHP Syntax Highlighter

Online syntax highlighting

PHP has a great function that automatically highlights PHP code called highlight_string(); this could be used to roll your own code highlighting on a site. In this demo I’ll show you the basics of how it works, then extended it with a few tricks.

Install Etherpad on SUSE Linux

Collaborate on documents in really real-time on SUSE Linux

EtherPad is the first web-based word processor that allows people to work together in really real-time.

All editing of the document is instantly visible on the screens of all participating users, enabling new and productive ways to collaborate on text documents. Etherpad is useful for meeting notes, drafting sessions, education, team programming, and more…

1. Online word-processor with formatting options
2. Letter by letter collaboration
3. Color-coded edits
4. Infinite Undo
5. History Playback
6. Import HTML, Word, RTF
7. Export as HTML, Word, PDF
8. Change Zoom
9. Super simple to embed into your own website/CMS with jQuery and PHP examples
10. Support with PHP, jQuery, Elgg, Apple devices, JavaScript, Ruby, Python etc.

Instructions for compiling and running the EtherPad open source release

How we can install Etherpad on Open SUSE Linux?

I just want to help you out… If you want to pay me nothing that is fine too! 😉

Here are some simple steps to install Etherpad on Open SUSE Linux…..

SUSE Linux is different from RedHat, CentOS or Ubuntu. General Package Managers / Setup Tool won’t work on SUSE, It support Zypper or YaST.

First check your server architecture

# uname -a

# cd /usr/local

Java 1.6 (tested with 1.6.0_20)
Scala 2.7 (tested with 2.7.7)
MySQL Server 5.1 (tested with 5.1.59)
mysql-connector-java (tested with 5.1.18)

Create username ‘etherpad’ with password ‘password’

# useradd -r -m etherpad
# passwd etherpad

Install Java

# uname -a
I am using 32-bit here…
# wget
# sh jdk-6u20-linux-i586-rpm.bin

# java -version

Install fastjar

# zypper install fastjar
# yast –install fastjar
# yast2 –install fastjar

Download Scala

# wget
# tar xvzf

Install MySQL

# zypper install mysql-server
# service mysqld start
# chkconfig mysqld on

Download MySQL Java Connector


# zypper install mysql-connector-java


# wget
# tar xvzf mysql-connector-java-5.1.18.tar.gz

Install MER­CU­R­IAL .. OR GIT

# zypper install mercurial

# zypper install git

Make sure port 9000 must be open on IPTABLES / Firewall

# /etc/sysconfig/iptables

-A RH-Firewall-1-INPUT -p tcp -m state –state NEW -m tcp –dport 9000 -j ACCEPT

Various scripts make assumptions about environment variables:

JAVA should be set to the java executable.
JAVA_HOME should be set to the main jdk directory.
SCALA should be set to the scala executable.
SCALA_HOME should be set to the main scala distribution directory.
PATH should contain $JAVA, $SCALA, and mysql
MYSQL_CONNECTOR_JAR should be set to the mysql-connector JAR file included in the mysql-connector download.
For example, this sets up the environment on my machine:

# touch myENV
# vi myENV

export JAVA_HOME=/usr/java/jdk1.6.0_20/
export JAVA=$JAVA_HOME/bin/java
export SCALA_HOME=/usr/local/scala/
export SCALA=$SCALA_HOME/bin/scala
export MYSQL_CONNECTOR_JAR=/usr/local/mysqlconnector/mysql-connector-java-5.1.18-bin.jar

# cat myENV >> /etc/profile

Download EtherPad

# hg clone etherpad

Some Changes in etherpad source for your server…


# cd /usr/local
# cd etherpad/trunk/etherpad
# cp etc/ data/











Database Setup
The scripts assume mysqld is running on localhost. Once mysqld is running, you can set up the etherpad database by running the following command inside ajcode/etherpad/.

# bin/
This will create a database called “etherpad” with the password “password”, and grant privileges to the user “etherpad”.

All the tables will be set up the first time etherpad is run.

EtherPad compiles all its Java and Scala libraries into a single JAR. To build this jar, you can run the following command inside ajcode/etherpad/.

# bin/
If you modify anything in ajcode/infrastructure, you will most likely need to kill the server, rebuild the jar, and re-launch the server before your change takes effect.

Code inside ajcode/etherpad/src can be modified while the server is running, and the changes will automatically get picked up.

To run the etherpad web server, execute the following command inside ajcode/etherpad/.

# bin/
The first time you run this, it should print out lots of messages about database migrations and finally print:

HTTP server listening on http://youdomain:9000/
At this point, you should be able to visit http://youdomain:9000/ in your web browser and create a new pad.

Thanks to Pauleira!

If you have error related to JVM

Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.

Fix using

# export _JAVA_OPTIONS=’-Xms32m -Xmx56m -Xss128k -XX:PermSize=32m -XX:MaxPermSize=64m’

Other Link:

Google Books Downloader

Book Search works just like web search. Try a search on Google Books or on When we find a book with content that contains a match for your search terms, we’ll link to it in your search results.

Google Books Downloader is a software that allows you to save these books in PDF, JPEG or PNG format.

We can get Embed link of Google Book from Embed code of Google Book…

<iframe frameborder="0" scrolling="no" style="border:0px"
width=500 height=500></iframe>

We have to enter above URL in Google Book URL: & then Start

After few minutes you can see Output Format: (default PDF) file in Output Folder: with default Resolution:


VMG2TXT converts Nokia VMG message file to text file.

VMG2TXT module is used for reading and parsing Nokia’s VMG message file format.

Sample Nokia VMG File

Output of VMGParser using PHP based tool 😉

Planning for mobile messages compatibility 😉
Next may be Nokia to Android message conversion.

Red5 figure out audio/video out of sync issue

I had worked Red5 WebCam application that lets users to record video clips from their webcams. The users could talk while they record clips.

I was using PHP with Zend Gdata for uploading recorded video clips to YouTube. But I had issue in FLV files generated by Red5 server, the clip’s audio / video content was out of sync. 🙁

Code to upload Red5 FLV to YouTube

Then after few searches I got… FFMpeg might be a good option to solve this issue to convert clip from FLV to MP4. 🙂


I have to add -itsoffset 00:00:01.16 before the -i, because flash player prompts user to allow or deny webcam access during the process the video begins to record. these are seconds of recording where nothing is recorded. To audio video sync add the itsoffset that tell ffmpeg to wait a second before it starts the the transcoding.

FFMpeg syntax to sync the audio and video using MP4 file:



$myVideoEntry = new Zend_Gdata_YouTube_VideoEntry();

$file= 'tmp/'.$fileName.".flv";

// convert FLV file to MP4 using -vcodec libx264

$mp4file= 'tmp/'.$fileName.".mp4"; 

exec("/usr/bin/ffmpeg -y -itsoffset 00:00:01.166000 -i ".$file." -s 640x480 -y -strict experimental -acodec aac -ab 128k -ac 2 -ar 48000 -vcodec libx264 -r 24 -g 48 -b 520000 -threads 64 ".$mp4file);

$file = $mp4file;

$file = realpath($file);  



Other Command
# /usr/bin/ffmpeg -i “svnlabs.flv” -s 640×480 -y -strict experimental -acodec aac -ab 128k -ac 2 -ar 48000 -vcodec libx264 -vpre medium -vpre ipod640 -r 24 -g 48 -b 520000 -threads 64 “svnlabs.mp4”

Related Article:

If you would hit the mark, you must aim a little above it…

Online Learning – Sharable Content Object Reference Model

E-Learning is a great way to spread knowledge in university, company or any other organization.

Sharable Content Object Reference Model (SCORM) is a collection of standards and specifications for web-based e-learning. It defines communications between client side content and a host system called the run-time environment, which is commonly supported by a learning management system.

There are various open source e-learning applications that can be installed easily…

Moodle is one of the most popular open source e-learning system. It is built with PHP & uses MySQL or PostgreSQL to store data. It has powerful course management features that covers creating lessons, assignments, quizes, documents, studnets, staff, reporting & more.

eFront is a complete e-learning software enables admins to create & manage lessons.

Dokeos offers course management features, Flash based videoconferencing, Powerpoint presentations can be imported and converted in to SCORM courses.

SCORM Cloud is our hosted SCORM player – so instead of using the one back in an LMS to launch a course, you can use ours from your Google domain. It will play your course, track the data and provide pretty reports right from the dashboard.

Claroline is an Open Source eLearning and eWorking platform allowing teachers to build effective online courses and to manage learning and collaborative activities on the web. Translated into 35 languages, Claroline has a large worldwide users’ and developers’ community.

ILIAS 4 e-Learning – Discover the flexible and powerful open source learning management system!

Sakai – A vibrant community creating technology that enhances teaching, learning and research.

ATutor is an Open Source Web-based Learning Management System (LMS) used to develop and deliver online courses. Administrators can install or update ATutor in minutes, develop custom themes to give ATutor a new look, and easily extend its functionality with feature modules. Educators can quickly assemble, package, and redistribute Web-based instructional content, easily import prepackaged content, and conduct their courses online.

Fle3 is a web-based learning environment. To be more specific Fle3 is server software for computer supported collaborative learning (CSCL).

LAMS is a revolutionary new tool for designing, managing and delivering online collaborative learning activities.

OLAT offers a flexible online course system along with extensive features to guarantee learning and teaching independent of time and place. It has been created especially for public institutions such as universities, academies or colleges, but it is also suitable for other businesses. – Joomla LMS that will turn your knowledge into dollars! Create an online course, university or school and make money while you sleep!

Joomla LMS – is an aggregate of e-learning tools compiling into a powerful learning management system for Joomla!. It is a fully functional eLearning platform with innovative training / testing options (self-assessments) and advanced conferencing applications. JoomlaLMS offers a wide range of useful online training features for teachers and learners.

Joomdle – Joomla + Moodle

Webinars –

BigBlueButton – BigBlueButton is a clean implementation of a web conferencing system that focuses on offering a simple user interface and an extensible platform for distance education.


DimDim – Easy, open, affordable collaboration for online meetings, eLearning, desktop sharing, training, distance education, webinar, free web meetings.


OpenMeetings is a free browser-based software that allows you to set up instantly a conference in the Web. You can use your microphone or webcam, share documents on a white board, share your screen or record meetings. It is available as hosted service or you download and install a package on your server with no limitations in usage or users.


We enable customers with advanced capabilities to manage Online Learning using above any web based tool. We can provide scheduling of Web Meetings, Logging, Tracking, Course Management, Staff / Student / Attendee / Host Management.

A teacher informs…
A good teacher explains…
A superior teacher demonstrates…
A Master inspires you by his being & learning happens….