Monday, August 24, 2009

About PHP5

PHP5 has improved support for OOPS when compared to PHP4. The 4 pillars of OOPS are fully supported by PHP5 i.e. Encapsulation, Inheritance, Polymorphism and Abstraction. You can also create interfaces; if you have been designing classes for a while, you know how important interfaces are.

Friday, August 21, 2009

Constructors

Constructors are functions in a class that are automatically called when you create a new instance of a class with new. A function becomes a constructor, when it has the same name as the class. If a class has no constructor, the constructor of the base class will be called, if it exists.

Tuesday, August 18, 2009

Some useful Crontab generator URLs

http://www.thepcmanwebsite.com/crontab_generator.shtml
http://www.openjs.com/scripts/jslibrary/demos/crontab.php
http://webtools.live2support.com/misc_crontab.php

Monday, August 17, 2009

Caching your pages with PhP

In the modern days, most of the sites are database driven. That means that your site is actually an application which retrieves data from a DBMS ( database managment system, eg MySQL) , parses the data and shows the result to the user. Most of these data are usually don't change frequently or don't change at all, and the reason that we use the database is that we can easilly update the site and the content.

A problem that this process creates is the server overhead. Every time we execute a query in the database, the instance of our script will call the DBMS, and then the DBMS will send the results of the query. This is time consuming, and especcially for sites with heavy traffic is a real big problem.

Uploading, Saving and Downloading Binary Data in a MySQL Database

This article is aimed at answering one of the most asked questions on the PHP mailing list and discussion forums alike: How to store binary files in a MySQL database.

VPS MySQL and Apache Optimization Guide

With a considerable number of webmasters switching to Virtual Private Servers (VPS) from shared hosting these days and preferring them over costlier fully dedicated servers, memory and resource optimization has become a burning issue. Most VPS packages being bought these days, have dedicated memory constraints of 128MB to 256MB. Apache and MySQL are known to be the most memory (resource) intensive applications that tend to crash or slow down a low to mid range VPS often. While OpenVZ or Virtuozzo based VPSs can have a burst memory limit in addition to the dedicated RAM to quench occassional high memory needs, Xen based VPSs cannot use more than the stipulated amount of dedicated RAM, adding to the problem.

Using Stored Procedures & MySQLI in PHP 5

For the occasions that you want to use a stored procedure you’ve written in MySQL 5 through PHP , the semantic tool to use is PHP’s built in mysqli objects/package.

According to the php.net: “The mysqli extension allows you to access the functionality provided by MySQL 4.1 and above.”

MySQLI stands for MySQL Improved, and it most certainly is with the addition of prepared statements and extensible Object Oriented interface.

How to Create an RSS Feed for Your Site in PHP

Most blogging platforms come with built-in support for RSS feeds. Why? It’s a great way for users to keep up to date on your new content. Instead of loading up a dozen favorite sites, they can look at one feed reader and then decide what to pursue further.

So what if you don’t use a blogging platform or CMS that creates a feed for you? You can create one yourself in PHP. It’s pretty simple.

PHP: Be Notified When Google Crawls Your Site

Have you ever wanted to know when Google crawls your website? Well now you can using a simple PHP script which emails you everytime GoogleBot crawls your site.

PHP and AJAX - Make a Password Strength Bar that Updates in Real-time

This tutorial will show you how to make a very simple feature which will help your users make more secure passwords, in registration forms. After the user types their password, this script will make a request to a PHP page, which will check the password for lowercase letters, uppercase letters, numbers and symbols. Without reloading the page, a bar displaying the strength of the password will be shown to the user.

Facebook like multi Toggle Comment Box with jQuery and PHP.

Implement Facebook like toggle comment box for every updated wall. Here is a simple example which contains of very simple jQuery and PHP code.

Thursday, August 06, 2009

Introduction to MySQL Views

By definition, view is a virtual or logical table which is composed of result set of a SELECT query. Because view is like the table which consists of row and column so you can retrieve and update data on it in the same way with table. View is dynamic so it is not related to the physical schema and it is only stored as view definition. When the tables which are the source data of a view changes; the data in the view change also.

MySQL Copying Data from one Table to a New One

In this tutorial, you will learn how to copy data from one table into a new table by using SQL CREATE TABLE and SELECT statement. Copying data from an existing table to a new one is useful in some cases such as backing up data, create a copying of real data for testing.

MySQL Commands

This article has a list of handy MySQL commands that we use time and time again. At the bottom are statements, clauses, and functions we can use in MySQL. Below that are PHP and Perl API functions we can use to interface with MySQL. To use those PHP need to build with MySQL functionality. To use MySQL with Perl the Perl modules DBI and DBD::mysql must be configured.

Monday, August 03, 2009

Building an IP-to-Country Mapping Application with PHP

Table of Contents:

1. Building an IP-to-Country Mapping Application with PHP
2. Start building an IP-to-country PHP application
3. Transferring the data of the IP-to-country database to the MySQL table
4. Importing records of the IP-to-country database to the MySQL table

The X-debug Extension

Table of Contents:

1. The X-debug Extension
2. Getting started using the X-debug library
3. Keeping track of file calls with the X-debug extension
4. Working with the xdebug_call_line() function

Building a Database-Driven Application with the Code Igniter PHP Framework

This article explains the below.

1. Introducing the Code Igniter PHP framework
2. Retrieving user-related data from a MySQL table
3. Defining a controller class
4. Outputting user-related data with Code Igniter

Designing a Captcha System with PHP and MySQL

This articles explains the below.

1. Designing a Captcha System with PHP and MySQL
2. The Captcha Image Generation Script
3. The PHP Form with Captcha-Generated Challenge
4. Captcha System Without GD Support

How to redirect browser to https (ssl) in php

Most of the e-commerce website uses payment gateway for online payment. And, those sites uses SSL (secure socket layer) connection to transfer data to and from the payment gateway.

In the common scenario, most of the sites uses “http” protocol and you can see “http” in the browser’s address bar. But in the above scenario,we need to redirect the browser to “https” which means that “Hypertext Transfer Protocol over Secure Socket Layer”.

Ok let’s see a real example, type “http://www.gmail.com” in browser after a while the “http” gets converted to “https” in address bar, which means this site is transferring the data over SSL protocal.

Creating and Parsing JSON data with PHP

This article describes about what is JSON and how we can handle it via PHP. Although, JSON stands JavaScript Object Notation, it is used by many other technologies like PHP and Java for data interchange format over the Internet.

5 useful url rewriting examples using .htaccess

If you are looking for the examples of URL rewriting then this post might be useful for you. In this post, they’ve given five useful examples of URL rewriting using .htacess. If you don’t know something about url rewriting then please check here for url rewriting using .htaccess.