Archive

Posts Tagged ‘PHP’

XML in PHP (version 5+)

Nov 20th, 2010

PHP 5 has many XML extensions. Each one has its own advantages and disadvantages. Which one to select for our task. Suppose you know some XML techniques and can dive into the XML extension whichever is suitable then you first need to know all the available extensions.
I tried to… (Continue)

Stateful Ajax experimentation

Nov 19th, 2010

Here is a JavaScript, PHP and HTML written during experiment with stateful Ajax. The code provide stateful Ajax. It maintains the stateful Ajax as you traveled the path. file1 and file2 is separate PHP file that Ajax loads. +ve Counter is provided by one PHP file and -ve Counter is… (Continue)

Observer Design Pattern – Usage and Example in PHP

Nov 19th, 2010

This is another post regarding design patterns. This time it is observer design pattern which is helpful in developing system having plugin facility and subscription based services. I will present example in PHP for Observer design pattern which is taken from Aaron Saray’s Professional PHP Design Patterns book on design… (Continue)

Strategy Design Pattern – Usage and Example in PHP

Nov 16th, 2010

Strategy design patterns is a behavioral design pattern that allow you select a algorithm from the available algorithms at the runtime. Client object can take any algorithm based on its need. It lets you choose strategy independently from client that use it. Each strategy encapsulated in itself, so client object… (Continue)

PHP: Get Headers using cURL

Nov 15th, 2010

How to get headers using cURL in PHP? We can know the health of a web page without visiting a link. We can get the information about link status whether is returning response 200 or it is moved it somewhere else or it is dead.

<?php
/**
* Script to… (Continue)

PHP and Mysql SQL Injection Example

Nov 12th, 2010

SQL injection is one very common attack on PHP application. Earlier PHP has magic_quotes_gpc() On by default but now after version 5.3 it will be deprecated. So, whatever security was available due to magic quotes will go after PHP version 5.3. For the attack, attacker need to know a little… (Continue)

Zend Framework Tutorial: Following another Quickstart

Nov 9th, 2010

I am following another quickstart tutorial for Zend Framework written by Rob Allen. This tutorial is far better than the tutorial on official zend framework site. I am also little experienced after following super tutorial on Zend Framework so it is gonna easier anyway.
I thought to write all commands… (Continue)

Zend Framework: Creating a Form

Nov 6th, 2010

Finally this Zend Framework quickstart/sample tutorial is over. At this last step of tutorial, I met error in very first command. The first command is: zf create form Guestbook.
Error is: PHP Fatal error: Call to a member function search() on a non-object in ..
when I used this command:… (Continue)

Python for PHP Developers

Nov 6th, 2010

From long time I was thinking about Python, and I spent some time with Python today. I cannot say it is good programming language or not, but I see lots of activity in Python field. I was impressed after seeing Python in Google App language list.
I  followed this article… (Continue)

Singleton Design Pattern – Usage and Example in PHP

Nov 6th, 2010

Singleton design pattern is useful when we need a one-of-its-kind object. Only single instance of a single pattern class is possible. This kind of class is generally useful in resource handling or in other use case where we need single instance of Object. Database connection handling is one such example.… (Continue)