Easy Mod_Rewrite with PHP tutorial
Published on : 10.03.2010
Category : PHP Viewed : 4 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 : 9 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 ==... |
The most simple PHP contact form
Published on : 10.03.2010
Category : PHP Viewed : 5 times.
In this tutorial, I’ll show you how to write the most basic PHP/HTML contact form script. So if you’re looking for validated forms or a fancy flash form, this tutorial isn’t for you.
Before you begin, make sure that your hosting provider supports PHP.
First, lets open Dreamweaver or your favorite text editor and start typing the following. You can copy it, but you should really type it out to get an understanding of how it is working. <html> <head>... |
Filtering Wordpress Categories Using an Undocumented Hook
Published on : 10.03.2010
Category : PHP Viewed : 6 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... |
Building a Simple Monthly Calendar
Published on : 07.03.2010
Category : PHP Viewed : 21 times.
In this tutorial we are going to learn how to build a simple calendar in PHP. You have seen many of those calendar date pickers mostly in Javascript. This PHP based one has a slightly different purpose - instead of populating an input field, it outputs links for the different dates and can be used for example as a monthly archive in a dynamic DB-driven site.
We will build this calendar following good coding practices and keeping the login in one PHP file and the presentation in one... |
Creating Email Templates in PHP
Published on : 07.03.2010
Category : PHP Viewed : 10 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 : 16 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... |
Simple PHP contact form
Published on : 07.03.2010
Category : PHP Viewed : 16 times.
In this tutorial, I’ll show you how to write the most basic PHP/HTML contact form script. So if you’re looking for validated forms or a fancy flash form, this tutorial isn’t for you.
Before you begin, make sure that your hosting provider supports PHP.
First, lets open Dreamweaver or your favorite text editor and start typing the following. You can copy it, but you should really type it out to get an understanding of how it is working. <html> <head>... |
Basic Bar Graph in Excel
Published on : 06.03.2010
Category : MS Excel Viewed : 23 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”... |