Archive for the 'PHP Basic' Category

Simple chatbox tutorial

Posted by admin on March 22 2010 Add Comments

Ok, this is going to be a tutorial that will show you how to build the frontend of a PHP/MYSQL based chatbox that has a WYSIWYG built in.
First we need to set up the mySQL database:
We’re going to call this table chatmessages for this tutorial. It needs 5 fields:
ID – Bigint, primary , [...]

How To Detect Internet Explorer Version With PHP

Posted by admin on January 11 2010 Add Comments

Awhile ago I needed to detect the Internet Explorer version of the visitor from inside of my PHP script. Being lazy I just tried to Google for some existing code, but to my surprise there was none available! Well, I think it’s time to rectify that problem by publishing the code I ended up creating. [...]

How to Install MySQL Database Server on Windows XP

Posted by admin on December 11 2009 Add Comments

Go to your desktop and inside the folder you have initially created find file mysql-5.0.41.win32.zip. Extract the content of this file to the same folder on the desktop. Now go inside mysql-5.0.41-win32 folder and double click Setup.exe. Follow the steps:

Fig. 18 – Click next.

Fig. 19 – Select Custom and click next.

Fig. 20 – Click Change [...]

How to Install PHP on Windows XP

Posted by admin on December 11 2009 Add Comments

Installing PHP on Windows XP

Go to your desktop and in the folder you initially created find file called php-5.2.3-Win32.zip.
Extract the content of this file to C:\webserver\php. Pull out all of the files from the php-5.2.3-Win32 folder and place them directly in C:\webserver\php.
Now we need to add our C:\webserver\php folder to the path of the Environment [...]

how to Installing Apache on Windows XP

Posted by admin on December 11 2009 Add Comments

how to Installing Apache on Windows XP

This tutorial will show you how to install Apache 2.0.59, PHP 5.2.3 and MySQL 5.0.41 on machine running Windows XP.
To start with we will download all of the necessary applications which can be found at the following locations:
Apache: Apache download page
File to download: Win32 Binary (MSI Installer): apache_2.0.59-win32-x86-no_ssl.msi
PHP: PHP [...]

Storing multidimensional arrays in a file

Posted by admin on December 11 2009 Add Comments

In this tutorial I will show you how to store a multidimensional array in a file and how to retrieve these data. With this method you can imitate a very basic database functionality.
Step 1.
To realize this we need to implement 2 methods. One for the storing array and one which reads the file back and [...]

How to execute PHP with cron

Posted by admin on December 11 2009 Add Comments

How to execute PHP with cron
Every now and then you will run across a task that needs to be executed through PHP however this task cannot or should not be ran by a visitor opening a webpage (such as a maintanance or caching script). The only way to run these scripts would be to do [...]

Generating random passwords

Posted by admin on December 11 2009 Add Comments

Generating random passwords
It becomes practical and more useful if the tutorial is written in the form of a funtction. This function will hopefully work anywhere.
The basic idea behind this random password is that it will give a different password every time it is called. This can only be done by using the time as the [...]

Looping Statements in PHP

Posted by admin on December 11 2009 Add Comments

In programming it is often required to repeat a block of code for a given number of times or until a certain condition is not true. For this, we use looping statements. PHP has two major looping statements (FOR and WHILE).
In common practice, FOR loop is mostly used when we need to loop a code [...]

PHP Login script tutorial

Posted by admin on December 11 2009 Add Comments

PHP Login script tutorial
Overview In this tutorial create 3 files
1. main_login.php
2. checklogin.php
3. login_success.php
Step
1. Create table “members” in database “test”.
2. Create file main_login.php.
3. Create file checklogin.php.
4. Create file login_success.php.
5. Create file logout.php
1- Create table “members”

Code:
CREATE TABLE `members` (
[...]