24 February 2015 07:30
What is AJAX and How it works ?
by calipussoftware (via)There will be hardly any web application in ear of web 2.0, which does not employ AJAX. Actually, you can’t imagine an interactive application without AJAX. AJAX is an integral part of web development stack. In this tutorial, we shall explain about AJAX and how can we implement AJAX.
Let’s start with what wikipedia says about AJAX.
1. A method for exchanging data asynchronously between browser and server, thereby avoiding page reloads. The XMLHttpRequest (XHR) object is usually used, but sometimes an IFrame object or a dynamically added tag is used instead.
2. A format for the data sent to the browser. Common formats include XML, pre-formatted HTML, plain text, and JavaScript Object Notation (JSON). This data could be created dynamically by some form of server-side scripting.
20 February 2015 13:45
What is spl_autoload_register, spl_autoload and autoload
by calipussoftware (via)PHP does have some awesome function which can be very handy. SPL register function is one of them, we are going to talk about.
As PHP manual says
spl_autoload_register — Register given function as __autoload() implementation
So what exactly it means ? Let’s try to understand with the help of an example.
function Autoloader($className)
{
require_once $path.$className.'.php';
}
spl_autoload_register('Autoloader');
$myObj = new MyClass();
Here we have just instantiated a class named as “MyClass” with out specifying include or require statements.
1
(2 marks)