"Lit the Candle"

Editing *.ctp file in Eclipse.

Eclipse is a famous editor for the development with php. But to code with cakephp we need to configure this eclipse editor. Because by default eclipse does not hightlight the html or php syntex of cakephp view file.Here are the steps to set up eclipse for highlighting the codes in a .ctp file.

  • Firstly open the  Eclipse workspace.
  • Now go to Preferences from Window menu.
  • From Preference click on the General tab from the list.
  • Now click on Content-Types under General  tab.
  • On the right panel in the Content-Types, expand the Text tab.
  • Select PHP Content-Types .
  • There are all the lists of  files associated with php in below e.g. *.php,*.php3,*.php4
  • Now click on the Add button and type the fie extension e.g. *.ctp in the content type input field.

Now you need to reopen the file  you are working on.

Happy coding :)

September 3, 2009 Posted by milansaha | CakePhp, Uncategorized | | No Comments Yet

PHP and Ajax for Beginners

AJAX is not a new programming language,it is a type of programming made popular by Google (with Google Suggest) to use existing standards based on JavaScript and HTTP requests.

With AJAX, your JavaScript can communicate directly with the server, using the JavaScript XMLHttpRequest object. With this object, your JavaScript can trade data with a web server, without reloading the page.

AJAX uses asynchronous data transfer (HTTP requests) between the browser and the web server, allowing web pages to request small bits of information from the server instead of whole pages.

The AJAX technique makes Internet applications smaller, faster and more user-friendly.

AJAX is a browser technology independent of web server software.

AJAX is based on the following web standards:

  • JavaScript
  • XML
  • HTML
  • CSS

There is nothing new to learn.AJAX is based on existing standards. These standards have been used by most developers for several years.The keystone of AJAX is the XMLHttpRequest object.

Different browsers use different methods to create the XMLHttpRequest object.

Internet Explorer uses an ActiveXObject, while other browsers uses the built-in JavaScript object called XMLHttpRequest.How the browsers work with ajax its depends these objects.

There are  three important properties of the XMLHttpRequest object.

a) The onreadystatechange Property

b) The readystate Property

c) The responseText Property

After a request to the server, we need a function that can receive the data that is returned by the server.

The onreadystatechange property stores your function that will process the response from a server. This is not a method, the function is stored in the property to be called automatically.

To send off a request to the server, we use the open() method and the send() method.

The open() method takes three arguments. The first argument defines which method to use when sending the request (GET or POST). The second argument specifies the URL of the server-side script. The third argument specifies that the request should be handled asynchronously. The send() method sends the request off to the server. If we assume that the HTML and PHP file are in the same directory, the code would be:

xmlHttp.open("GET","sample.php",true);
xmlHttp.send(null);

For a  example of php and ajax you should have a look at this link.

While responseText returns the HTTP response as a string, responseXML returns the response as XML.

The ResponseXML property returns an XML document object, which can be examined and parsed using W3C DOM node tree methods and properties.

As an example of Ajax ResponseXML you can try the this one.

By this time i hope that you got the very basic of ajax functionality. Now its your time to play more with Ajax.

March 23, 2009 Posted by milansaha | Ajax, Uncategorized | | No Comments Yet

বন্ধু তোর লাইগা রে

বন্ধু তোর লাইগা রে

বন্ধু তোর লাইগা রে
বন্ধু তোর লাইগা রে
আমার তনু জড়জড়
মনে লয় ছাড়িয়ারে যাইতাম
থুইয়া বাড়ি ঘর
বন্ধু তোর লাইগা রে

অরণ্য জঙ্গলার মাঝে
আমার একখান ঘর
ভাইয়ো নাই বান্ধবও নাই মোর
কে লইবো খবর হায়রে
বন্ধু তোর লাইগা রে

বট বৃক্ষের তলে আইলাম
ছায়া পাইবার আশে
তাল ভাঙ্গিয়া রৌদ্র ওঠে
আমার কর্মদোষে
বন্ধু তোর লাইগা রে

নদী পাড় হইতে গেলাম
নদীরও কিনারে
নদীরও কিনার বানাইয়া
নদী পাড় হইতে গেলাম
নদীরও কিনারে
আমারে দেখিয়ারে নৌকা
সরে দুরে দুরে হায়রে
বন্ধু তোর লাইগা রে

সৈয়দ শাহ নূরে কান্দইন
নদীর কুলো বইয়া
পাড় হইমু পাড় হইমু কইরা
দিনতো যায় চলিয়া হায়রে
বন্ধু তোর লাইগা রে

——
সৈয়দ শাহ নূর

March 9, 2009 Posted by milansaha | Bangla Song Lyric, Uncategorized | | No Comments Yet