Home arrow PHP arrow Page 5 - Chatter

Secure it - PHP

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

You may have noticed that cbadmin.php calls a file called accesscontrol.php on the first line. This file is used to place a password on your chatterblock admin area.

<?php
$adlogin = "test";
$adpassword = "test";
if (!isset($PHP_AUTH_USER)) {
header('WWW-Authenticate: Basic realm="ChatterBlock Admin"');
header('HTTP/1.0 401 Unauthorized');
echo 'Authorization Required.';
exit;
} else if (isset($PHP_AUTH_USER)) {
if (($PHP_AUTH_USER != $adlogin) || ($PHP_AUTH_PW != $adpassword)) {
header('WWW-Authenticate: Basic realm="ChatterBlock Admin"');
header('HTTP/1.0 401 Unauthorized');
echo 'Authorization Required.';
exit;
}else{
session_register("aid");
session_register("apass");
}
}
?>

Save this file as accesscontrol.php, and you will now have password protection on your ChatterBlock Admin script.

Conclusion

That's it. A quick and fast tutorial. This chatterblock is very basic, can post and can view. It doesn't really have other nifty functions such as smilies or profanities checking. Once you get the basic chatterblock, you can always add features and functions later on.



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

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

PHP ARTICLES

- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- 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...

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: