Home ->
Computer Programming ->
DHTML ->
Reading...
Design an Online Chat Room with PHP and MySQL
Author:Rory Canyon Source:Internet Dateline:2008-01-04 13:11 Hits:0
In this article, you will learn how to design and develop a simple online chat room with PHP and MySQL. This tutorial explains every steps of the development, including both database design and PHP
programming. Basic computer skills and knowledge of HTML and PHP are required. Ok, let's begin now. Step 1: Design Database Table. Create table "chat" in MySQL database to store basic chat
information: chtime (chat time), nick (user nickname) and words (chat message, less than 150 characters) mysql> CREATE TABLE chat -> chtime DATATIME, -> nick CHAR (10) NOT NULL, ->
words CHAR (150); Step 2: Design Structure. This simple online chat room includes the following four sections: user login, message display, message input and a main frame integrating the display
and input sections. Thus, it needs the following four files to work: login.php, main.php, display.php and speak.php. Step 3: Write the code 1. login.php (just a HTML form) Please input your
nickname and enter
2. main.php
setcookie("nick",$nick) //use cookie to store user nickname
?>
JS FINDER is a place to share articles free. All articles are provided for educational purposes and personal use only.
Copyright of the original articles belong to the author(s). If you do not want your articles suggested(submit) by someone, please
send a message to us. We will review them in five business days. You can write articles or suggest other authors articles.
Submit your articles now!