Home » Archive

Articles in the PHP Category

Magento, PHP, Review »

[8 Mar 2010 | 5 Comments]

PACKT Publishing has published a very useful Magento Developer Guide. This book has practical tutorials with examples. This book will be very useful for PHP Programmers who want to learn Magento architecture, extend the system and add new features to it.

jQuery, PHP »

[20 Jan 2010 | 23 Comments]

In this article, I will be showing you how to create jQuery AJAX tabs in a very simple and easy way.
View Demo || Download Code
Here, tabs.php contains the php code which contains data to be displayed.

PHP »

[14 Jan 2010 | One Comment]

Below are the most commonly used php directives. You have to change php.ini file in order to configure php settings. This just means changing these directive’s option and value.
1) short_open_tag = Off

PHP »

[14 Jan 2010 | One Comment]

We can view the php settings by creating a php file in our web root with the following code:

Let the name of the file be phpinfo.php

PHP, XML »

[23 Oct 2009 | 2 Comments]

In this article, I will be showing you how to create and read xml document with php’s DOMDocument.
The DOM extension allows you to operate on XML documents through the DOM API with PHP 5.
Below is the code to create XML file. I have named the output file ‘example.xml’. For better understanding, I have written comment for almost every line of code.

Javascript, PHP »

[23 Oct 2009 | No Comment]

I had to work on multi-dimensional array with javascript and php. I had a multi-dimensional array in php. I had to load it into javascript array and then populate the html selection list.
The challenge for me was to create multi-dimensional array in javascript and populate selection list with for loop in javascript.

PHP, XML »

[23 Oct 2009 | 2 Comments]

In this article, I will be showing you how to create and read xml document with php’s SimpleXML extension.
The SimpleXML extension provides a very simple and easily usable toolset to convert XML to an object that can be processed with normal property selectors and array iterators.

jQuery, PHP »

[29 Jun 2009 | 10 Comments]

This tutorial shows how easy it is to upload multiple files using jQuery and PHP.
I have used jQuery MultiFile Plugin for this purpose.
The input type file should have name in list format like “pic[]” and the class name of the input should be “multi”.

PHP »

[29 Jun 2009 | No Comment]

This tutorial shows site name, working directory name, etc. with the help of $_SERVER variable.
Let us suppose, that our website is:
http://wwww.example.com/test/admin/index.php

PHP »

[14 Nov 2008 | 2 Comments]

Earlier I had written an article on How to get(view) html source code of a website . I had created an application and that would grab the html code of any website. In this article, I will be writing on how you can modify the looks of a website by changing the html source code after you grab it.
At first the html source code getting part. I have commented in the code for better understanding.

PHP »

[2 Jul 2008 | 4 Comments]

Here is the PHP code to fetch the html source code of any website specified. fopen function is used to open the website URL. stream_get_contents is used to read the opened URL. The fetched code is displayed inside a textarea.

MySQL, PHP »

[5 Mar 2008 | 55 Comments]

In this article, I will be presenting simple PHP & MySQL code to add, edit, delete and view data. This kind of system is also referred to CRUD (Create, Read, Update, Delete).
Here is a step-by-step guide on creating a CRUD system using PHP & MySQL:

PHP »

[5 Mar 2008 | 2 Comments]

Here are code samples to generate random number and strings in PHP.
Generate random numbers between 1 and 1000

PHP, Regular Expression »

[2 Mar 2008 | 7 Comments]

This article contains PHP code with regular expression to validate different numbers and strings. Integer validation can be done for validating age. Decimal validation can be done for validating price. Simple String validation can be done for validating name. Email validation can be done for validating email.
preg_match PHP function is used to perform the regular expression match.

HTML, PHP »

[9 Dec 2007 | 2 Comments]

Problem:
I want to create a dynamic HTML table with a row starting after certain number of columns, i.e. like, i want to create an html table which automatically generate new row after 3 columns in a row.
Solution: