Home arrow PHP arrow Chatter

Chatter

This tutorial shows you how to make a ChatterBlock. ChatterBlocks are small windows where users can type in messages. They're also called Shout Boxes or TagBoards and are kind of like miniature chat rooms.

TABLE OF CONTENTS:
  1. Chatter
  2. Configuration
  3. View Chatter
  4. Manage the Chatter
  5. Secure it
By: Roger Stringer
Rating: starstarstarstarstar / 29
November 08, 2004

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

Chatter Form

Let's make the chatter form first. Open Notepad or your editor, cut and paste the following HTML code and save this file as chatter.html .

<iframe src='view.php' border='0' name='chatterblock' width="120" height="180" frameborder="0" framespacing="0"></iframe><br>
<form action='post.php' method='post' target='chatterblock'>
<input type='text' name='name' value='name'><br>
<input type='text' name='url' value='http://'><br>
<input type='text' name='msg' value='message' maxlength="100"><br>
<input type='submit' value='Talk'>
</form>

The code above creates an iframe code, and a small form for users to enter their name, url and messages. This will also be the code that you can cut and paste into part of your navigation.

This code can be inserted into your own Web pages as well. We use the same code here at QuickPipe for our ChatterBlock.

The Database

Before we go any further, we must create the database schema for MySQL for the ChatterBlock entries. Cut and paste the following code into MySQL either via Telnet, PhpmyAdmin or any other means of communicating with MySQL.

CREATE TABLE chatterblock(
id INT (4) not null AUTO_INCREMENT,
name VARCHAR (32),
msg VARCHAR (100),
url VARCHAR (32) ,
entered DATETIME,
ip varchar(16),
PRIMARY KEY (id));

CREATE TABLE blocked_ips(
id INT (4) not null AUTO_INCREMENT,
ip varchar(16),
PRIMARY KEY (id));

CREATE TABLE blocked_nicks(
id INT (4) not null AUTO_INCREMENT,
name varchar(32),
PRIMARY KEY (id));

As we start off, the msg variable in the 'chatterblock' table only allows 100 characters. If you find your chatterblock too limiting, you can increase the number of characters in the schema. Don't forget to update the HTML code and set maxlength to your new limit.



 
 
>>> More PHP Articles          >>> More By Roger Stringer
 

blog comments powered by Disqus
   

PHP ARTICLES

- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...
- PHP: Building Concrete Validators
- Sanitizing Input with PHP
- Executing Shell Commands with PHP
- Handling File Data with PHP
- File Security and Resources with PHP
- ArrayObject PHP Class Examples
- ArrayObject PHP Class: An Introduction
- Getting File System Data with PHP
- PHP Tools for Working with the File and Oper...
- Working with the File and Operating System w...
- PHP Proxy Patterns: Completing a Blog


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 1 - Follow our Sitemap

Dev Shed Tutorial Topics: