PHPBuilder - PHP-Based Chat Room Page 2



RSS Twitter
Articles Html

PHP-Based Chat Room - Page 2

by: Mike Hall
|
July 30, 2000

We're nearly ready write our message file. All we need are headers and footers. Start simple with the headers:

<?php 

// It's important that there are no newline
// characters except at the end of the string.
// This keeps all the headers together.
$header "<html><body bgcolor=\"#000000\" text=\"#ffffff\">\n";

?>
We want the message screen to auto refresh so people viewing the site can see new posts. In preference to using JavaScript, I use an META refresh, principally because it's more likely to be supported client-side. I also don't want the search engines indexing my message file. So we refine $header to :

<?php 

$header 
"<html><head><meta http-equiv=\"refresh\" content=\"8\">".
    
"<meta name=\"robots\" content=\"noindex\"></head>".
    
"<body bgcolor=\"#000000\" text=\"#ffffff\">\n";

?>
In the file footer I tend to put a little copyright information as well as close the tags I opened in the header.

<?php 

$footer 
"<p align=\"center\"><font color=\"#000000\">".
    
"&copy; Mike Hall 2000</font></p></body></html>";

?>
Wrapping the copyright in <font color="#000000"> means that unless selected it'll be invisible against the equally #000000 background. This just stops it being intrusive.

« Previous Page
1
|
2
|
3
|
4
|
5
|
6
Next Page »

Comment and Contribute

Your comment has been submitted and is pending approval.

Author:
Mike Hall

Comment:



Comment:

(Maximum characters: 1200). You have characters left.