You need three files:
messages.txt (chmod 755)
button.gif
index.php (chmod 755)
source of index.php:
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>
<?php
header("Content-type: text/html; charset=utf-8");
$name = $_POST['name'];
$message = $_POST['message'];
if ($name !='')
{
if ($message !='')
{
$file = fopen('messages.txt', 'r+');
$ind=file_get_contents ('messages.txt');
$mess1='['.$_POST['name'].'] '.stripslashes($message).'
'.$ind;
fputs($file, $mess1);
fclose($file);
}
echo '
<html>
<head>
<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=utf-8">';
echo '<title>'.$_POST['name'].'@mobile.universumi.org</title>';
echo '</head>
<body bgcolor="#FFFF99">';
echo '<form action="index.php" method="post">
<input type="hidden" name="name" value="'.$_POST['name'].'">
<input type="text" name="message" maxlength="256">
<input type="submit" value="Send / Refresh"></form>';
echo "\n";
$lines=file('messages.txt');
$num = count($lines);
for ($i=0; $i<15; $i++)
{
echo $lines[$i]."\n";
}
echo '</body></html>';}
else
{
echo '
<html>
<head>
<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=utf-8">';
echo "<title>mobile.universumi.org</title>";
echo '</head>
<body bgcolor="#FFFF99">
';
echo '<center><form action="index.php" method="post">
<input type="text" name="name" value="Username" maxlength="16">
<input type="image" src="http://www.universumi.org/ngeo/button.gif" alt="Kirjaudu" />
</form></center>';
echo '</body></html>';
}
?>
</div>
messages.txt (chmod 755)
button.gif
index.php (chmod 755)
source of index.php:
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>
<?php
header("Content-type: text/html; charset=utf-8");
$name = $_POST['name'];
$message = $_POST['message'];
if ($name !='')
{
if ($message !='')
{
$file = fopen('messages.txt', 'r+');
$ind=file_get_contents ('messages.txt');
$mess1='['.$_POST['name'].'] '.stripslashes($message).'
'.$ind;
fputs($file, $mess1);
fclose($file);
}
echo '
<html>
<head>
<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=utf-8">';
echo '<title>'.$_POST['name'].'@mobile.universumi.org</title>';
echo '</head>
<body bgcolor="#FFFF99">';
echo '<form action="index.php" method="post">
<input type="hidden" name="name" value="'.$_POST['name'].'">
<input type="text" name="message" maxlength="256">
<input type="submit" value="Send / Refresh"></form>';
echo "\n";
$lines=file('messages.txt');
$num = count($lines);
for ($i=0; $i<15; $i++)
{
echo $lines[$i]."\n";
}
echo '</body></html>';}
else
{
echo '
<html>
<head>
<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=utf-8">';
echo "<title>mobile.universumi.org</title>";
echo '</head>
<body bgcolor="#FFFF99">
';
echo '<center><form action="index.php" method="post">
<input type="text" name="name" value="Username" maxlength="16">
<input type="image" src="http://www.universumi.org/ngeo/button.gif" alt="Kirjaudu" />
</form></center>';
echo '</body></html>';
}
?>
</div>
Comment