A small board for communication between
sysadmins or such like. Or at least thats why I designed it. If you need to keep admins up to date then use this. Its simple easy and basic. Only has 4 user support, but its brill for a small team building a website.
By : rock
<?php
/*
A small board for communication between
sysadmins or such like.
The board uses file access to display the
messages. Search and replace message2 with
the users name required and do the same for
the other users. Once logged in just Click
on the radio box you wish to post to and
then just write your message. Click POST
and hey presto Bob's your uncle.
The user is identified by $REMOTE_USER
If the user is identified then he/she can
delete his/her own messages.
$REMOTE_USER is an apache variable and can
be used. Or you can write a login script to
parse the variable.
*/
?>
<html>
<head>
</head>
<body>
<?
function date_str($timestamp) {
$date_str = getdate($timestamp);
$year = $date_str["year"];
$mon = $date_str["mon"];
$mday = $date_str["mday"];
$hours = $date_str["hours"];
$minutes = $date_str["minutes"];
$seconds = $date_str["seconds"];
return "$hours:$minutes:$seconds $mday/$mon/$year";
}
$message1 = "message1.txt";
$message2 = "message2.txt";
$message3 = "message3.txt";
$message4 = "message4.txt";
if ($deluser) {
copy("./blank.txt", "./$deluser.txt");
}
$message1fp = fopen("./message1.txt", "a+");
$message2fp = fopen("./message2.txt", "a+");
$message3fp = fopen("./message3.txt", "a+");
$message4fp = fopen("./message4.txt", "a+");
if ($postto == "message2") fwrite($message2fp, $posttext);
else if ($postto == "messagel") fwrite($message1fp, $posttext);
else if ($postto == "message3") fwrite($message3fp, $posttext);
else if ($postto == "message4") fwrite($message4fp, $posttext);
else echo "......";
if ($REMOTE_USER) echo "Welcome: $REMOTE_USER";
else echo "Welcome: Unknow person";
?>
<form method=post action="./post.php">
<table width=100% border=1>
<tr><td bgcolor=gray width=50%><font size=1><b>message2</b> - Last Modified <? echo date_str(filemtime($message2)); ?>   <input type=radio name="postto" value="message2">
<td bgcolor=gray width=50%><font size=1><b>message3</b> - Last Modified <? echo date_str(filemtime($message3)); ?>   <input type=radio name="postto" value="message3">
<tr><td><?
$lines = file($message2);
while (list($ElementIndexValue, $ElementContents) = each($lines))
{
echo $ElementContents."<br>";
}
?><td> <?
$lines = file($message3);
while (list($ElementIndexValue, $ElementContents) = each($lines))
{
echo $ElementContents."<br>";
}
?>
<tr><td bgcolor=gray width=50%><font size=1><b>message1</b> - Last Modified <? echo date_str(filemtime($message1)); ?>   <input type=radio name="postto" value="message1">
<td bgcolor=gray width=50%><font size=1><b>message4</b> - Last Modified <? echo date_str(filemtime($message4)); ?>   <input type=radio name="postto" value="message4">
<tr><td> <?
$lines = file($message1);
while (list($ElementIndexValue, $ElementContents) = each($lines))
{
echo $ElementContents."<br>";
}
?> <td> <?
$lines = file($message4);
while (list($ElementIndexValue, $ElementContents) = each($lines))
{
echo $ElementContents."<br>";
}
?>
</table>
<center>
<TEXTAREA name="posttext" cols=60 rows=15></TEXTAREA>
<br>
<input type=submit value="Post Message">
</form>
<p>
<form method=post action="./post.php">
<input type=hidden name="deluser" value="<? echo $REMOTE_USER; ?>">
<input type=submit value="Delete my messages">
</form>
<p>
<?
fclose($message1fp);
fclose($message2fp);
fclose($message4fp);
fclose($message3fp);
?>
</html>
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |
More Discussion Board Code Articles
More By Codewalkers
developerWorks - FREE Tools! |
<a href="http://zeus.developershed.com/shonuff.php?blackbird=3853&zoneid=442&source=&dest=http%3A%2F%2Fwww.ibm.com%2Fdeveloperworks%2Fspaces%2Fjazz%3FS_TACT%3D105AGY31%26S_CMP%3DDEVSHED&ismap="><img src="http://images.devshed.com/corp/img/news/jazz01.gif" alt="developerWorks Jazz space" align="left"></a>You've heard the buzz about Jazz... want to know more about it from a developer's perspective? Check out the Jazz space on developerWorks. This space is an up-to-date resource for developers, including technical information about Jazz and products built on Jazz, like Rational Team Concert Express. The Jazz space includes content from a wide variety of sources, including links, feeds, and comments from experts. FREE! Go There Now!
|
|
|
|
Discover how IBM Rational AppScan Standard Edition can help you detext vulnerabilities in your web applications in the Web Application Security eKit. IBM Rational AppScan is a leading suite of automated web application security solutions that scan and test for common Web application vulnerabilities. The new Web Application Security eKit provides you with valuable resources, including white papers, demos, and additional information on the benefits of testing your Web applications. FREE! Go There Now!
|
|
|
|
In this tutorial, you can learn how to install and configure the IBM Rational Asset Manager Eclipse client, explore the different views in the Asset Management perspective, learn various search techniques, work with existing assets, and submit a new asset. FREE! Go There Now!
|
|
|
|
This tutorial shows new users of IBM WebSphere Business Monitor Version 6.0.2 how to perform the "Hello World" equivalent for monitoring business process applications. It is intended to help you get familiar with the capabilities of the product. FREE! Go There Now!
|
|
|
|
Analysts, architects, and developers who have existing COBOL or PL/I skills and want to extend those skills to deploy new workloads on the mainframe can use the IBM Enterprise Modernization Sandbox for System z to find hands-on walkthroughs of common real world scenarios. The scenarios provide examples of how to rapidly design, create, assemble, test, and deploy high-quality Web, Web services, portal, and SOA applications for IBM CICS, IBM IMS, and IBM WebSphere Application Server. FREE! Go There Now!
|
|
|
|
Ken Krugler, co-founder of code search company Krugle, and Laura Merling, vice president of Marketing and Business Development for Krugle, join to talk about the ins and outs of code search and what it means as a new feature for developerWorks users. FREE! Go There Now!
|
|
|
|
Get a free trial download of IBM Lotus Forms V3.0 (formerly Workplace Forms), which provides a zero-footprint eForms solution to help you automate and move forms-based business processes off the desktop and onto the Web. With Lotus Forms, you can extend applications beyond the firewall by creating a single electronic form document ready for use in both thick and Web 2.0 thin client format. FREE! Go There Now!
|
|
|
|
In this webcast, IBM Rational will discuss the importance of Web application security and will share techniques and best practices to introduce application security testing into current QA processes including: understanding common security vulnerabilities and techniques to integrate security testing with defect tracking and remediation systems in an effort to safeguard sensitive online information. FREE! Go There Now!
|
|
|
|
The discipline of assembling and delivering software is maturing beyond standard developer-centric compile/test software builds. The end-to-end software development lifecycle is emerging as the new focus moves “Beyond the Build.” Join this on demand webcast to learn about methods for streamlining software delivery and key capabilities of the IBM Rational Build Forge framework for automating build and release management in environments of any size. FREE! Go There Now!
|
|
|
|
Viper 2 brings a great value to developer communities including SQL, XML, PHP, Ruby, .NET and Java. You probably already know that DB2 Express-C is free for developers to develop, deploy and distribute. Viper 2 provides a variety of means that help move your application from the development stage to deployment more rapidly. This webcast shows how to best utilize the latest tools available for developing DB2 applications. FREE! Go There Now!
|
|
|
|
All FREE IBM® developerWorks Tools! |