#native_company# #native_desc#
#native_cta#

Storing Data in the Client Page 3

By PHP Builder Staff
on July 30, 2000

PHP & JavaScript World Domination Series: Storing data in the client.

Action!

Please create a test database with mysql (mysqladmin create testbase) and then
create a table with:

create table testeable (
  timestamp datetime,
  message	text
);

This is the “master” file:

<script>
lines=new Array();
function displaymsgs() {
  for(i=0;i<lines.length;i++) {
	 display.document.write(lines[i]);
	 display.document.write('<BR>');
  }
}
</script>
<frameset cols="1" rows="20,60,20" border="0">
<frame name="loader" src="loader.php">
<frame name="display" src="display.php">
<frame name="form" src="form.php">
</frameset>

Note that we have the loader frame, the display frame and a new frame called “form”, this
is the form we use to send messages to the chat room.
Note the simple “display” function, you can use whatever you want here, colors, dynamic
colors, user preferences, html tables, images, etc etc.

The display frame is:

<script>
top.displaymsgs();
</script>

We promised it will be short 🙂