Easy Mod_Rewrite with PHP tutorial
Published on : 10.03.2010
Category : PHP Viewed : 22 times.
I have been playing around with Apaches mod_rewrite on my other site http://www.2big2send.com and i must admit its a whole lot easier than i first thought..
Here is a quick guide for most general use:
Create a new file in your main directory (public_html for cPanel or httpdocs for plesk – not sure about other ones) called .htaccess (Dont forget the ‘.’ dot before the name – you may already have one of these file, thats ok, just edit it and follow the guide... |
Simple site stats counter
Published on : 10.03.2010
Category : PHP Viewed : 13 times.
This script is simple because it's using this flatfile thingy and it uses files as databases. That means you will take info and write it into another file so back to this tutorial. First make a file called counter.txt and change it's CHMOD to 777
<?php//User referer$referer = $_SERVER['HTTP_REFERER'];// User ip$ip = $_SERVER['REMOTE_ADDR'];//Your browser info$browser = $_SERVER['HTTP_USER_AGENT'];//Date$date = date('r'); // Theres no referer then it will be marked with -if($ref ==... |
Filtering Wordpress Categories Using an Undocumented Hook
Published on : 10.03.2010
Category : PHP Viewed : 9 times.
In this article, we will briefly cover Wordpress hooks and use an undocumented one in order to manipulate category listings.
After some further digging, while it is not listed on the Wordpress filter list, it appears that this “undocumented hook” is mentioned on the get_terms() function reference. So, we’ll call this a somewhat undocumented hook.
Anybody who knows me knows that I love Wordpress, if perhaps not more than any man should love a collection of code. I... |
Creating Email Templates in PHP
Published on : 07.03.2010
Category : PHP Viewed : 12 times.
The technique is simple
The template text (including variables and html tags) will be stored in database. We will create a table with 2 fields i.e name and text. Each template will be give a unique name. A sample entry is shown in the image below
A PHP script will read template text from the database, update varlues of variables and will send the email
For this tutorial, i haved created a table to store all the templates a webiste needs. See a snapshot of this table below
Every... |
Displaying Records in Multiple Columns Using PHP
Published on : 07.03.2010
Category : PHP Viewed : 13 times.
For this article, i have selected a table members, containing each member's pic and some other text detail. The members will be shown in multiple columns as shown in the picture below.
The technique is to use 2 loops (one nested inside the other). The outter loop creates rows and the inner loop creates columns. The only thing we have to take care of is the inner loop creates equal number of columns for each row. If there are no more records the inner loop should print a blank column.... |
Creating a Basic Template System in PHP
Published on : 07.03.2010
Category : PHP Viewed : 17 times.
After implmenting this template system in your webistes, you will achieve the following benefits
If you have a lot of pages that use the same design. If you want to make a layout change in the header, menu, footer or right section then you don't have to update numerous files. You will have to edit a single php file
You will have less vertical scrolling when typing PHP code as the whole section will be replaced by a single line of php (i.e we will use php include function to include... |
Basic Bar Graph in Excel
Published on : 06.03.2010
Category : MS Excel Viewed : 24 times.
The following tutorial will demonstrate how to construct a basic bar graph in Excel. The documents for this tutorial are available for download.
Download the 97-2003 Version
Download the Excel 2007 Version
To begin, start with a spread sheet as shown below.
Now, highlight cells A3 to B8. Select the “Insert” tab and hit the “Column Button” to activate the drop down menu.
From this menu, select “2-D Column”... |
Multiply in Excel
Published on : 06.03.2010
Category : MS Excel Viewed : 16 times.
Multiplication is essential in Excel. Luckily it is extremely easy.
To multiply numbers or cells in Excel, we must use a basic formula. All Formula’s in Excel begin with “=”
Multiplication is essential in Excel. Luckily it is extremely easy.
To multiply numbers or cells in Excel, we must use a basic formula. All Formula’s in Excel begin with “=”
The asterisk “*” is used as the multiplication symbol between cells. In... |
Some Linux admin commands everyone must know
Published on : 02.03.2010
Category : Linux Viewed : 32 times.
I assume you know how to login and logout from Linux system and one Linux system is available in your network. Since this tutorial is based on admin commands, you should have access to the system with root privilege. For connecting to Linux you need any Telnet/SSH client like PuTTY. If you don’t have one yet, download PuTTY from the following site.
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
OK, open your client, give host name/IP address and press Open button.... |
Create a KVM-based virtual server in 3 steps
Published on : 02.03.2010
Category : Linux Viewed : 52 times.
The Linux Kernel-based Virtual Machine (KVM) is free, open source virtualization software for Linux based on the Intel VT-X and AMD-V hardware virtualization extensions and a modified version of QEMU (work is underway to get the required changes upstream). KVM—in the form of kvm.ko, a loadable kernel module that provides the core virtualization infrastructure and processor-specific modules kvm-intel.ko... |