===================
Create note.php First
<style type= "Text/css" >
<!--
. {font-family: "Song body"; font-size:9pt;}
-
</style>
<body bgcolor= #cccccc >
<center><font style= "Color=color: #cccccc; font-size:12pt" >php Message book </font>
<form method= "POST" action= "result.php" >
<table border=1 width=555>
<tr>
<TD width=20%> Your Name:
</td>
<TD width=50%><input type=text name=nickname style=width:100%>
</td>
</tr>
<tr>
<TD width=20%> Email:
</td>
<TD width=50%><input type=text Name=email style=width:100%>
</td>
</tr>
<tr >
<TD width=20%> Message:<br><br><br>
</td>
<TD width=80%> <textarea name=notes cols= "" rows= "5" ></textarea>
</td>
</tr>
<tr>
<TD width=20%> </td>
<TD width=80% align=center><input type= "Submit" Name=submit value= "OK" ><input type= "reset" value= "override" ><input name=clear type= "Submit" value= "clear" >
</td>
</tr></table>
</form></table>
<table border=1 width=555>
<tr><td>
$f = fopen ("Note.txt", "R");
$msg = Fread ($f, FileSize ("Note.txt"));
Fclose ($f);
print "$msg";
?></td>
</tr>
</table>
</center>
<p align=right><font style= "Color=color: #cccccc; font-size:12pt" ><a href= "Mailto:dengfzj @126. COM"> industry such as </a><br>
Home: <a href= "Http://weibo.com/dengyr" > Weibo </a></font>
</body>
And then create
result.php
<style type= "Text/css" >
</style>
<body bgcolor= #cccccc >
<table align=center border=0 width=555> <tr>
<?php
First decide whether to clear
if ($_post["clear"]== "purge")
{
Print "<td align=center><b>
$f =fopen ("Note.txt", "w");
Fwrite ($f, "");
Fclose ($f);
}
else{
if (($_post["nickname"]&&$_post["email"]&&$_post["notes"])!=0)
{
$t = Date (y year M d Day);
$note =str_replace ("<", "<", $_post["notes"]);
$note =str_replace (">", ">", $note);
$note =str_replace ("
"," <br> ", $note);
$main = "<font color= #FF6600 > Online name: </font><a href=mailto:". $_post
["Email"]. " > ". $_post[" nickname "]." </a> (". $t.") <br><font color= #FF6600 >
Message:</font> ". $note." <br>$f =fopen ("Note.txt", "a");
Fwrite ($f, $main);
Fclose ($f);
Print "<td align=center><b>
print "$main";
Print "<b><font font-size=9pt color= #FF99FF > Thank you for your message!</font><br>";
}
else{
if ($_post["nickname"]== "")
Print "<b><font font-size=9pt color= #00CC00 > your name? </font><br> ";
if ($_post["email"]== "")
Print "<b><font font-size=9pt color= #00CC00 > your email? </font><br> ";
if ($_post["notes"]== "")
Print "<b><font font-size=9pt color= #00CC00 > You have nothing to say? </font><br> ";
Print "<td align=center><b>
}
}
?> </tr>
</table>
<p><br></p>
<p><br></p>
<center><a href= "note.php" > Back </a></center>
<p><br></p>
<p align=right><font style= "Color=color: #cccccc; font-size:12pt" >
<a href= "Mailto:dengfzj@126.com" > Industry such as </a><br>
Home: <a href= "Http://weibo.com/dengyr" > Weibo </a></font>
</body>
The OK code is over.
PHP Message Board Program