PHP Message Board Program

Source: Internet
Author: User

===================

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>
&LT;TD width=20%> Your Name:
</td>
&LT;TD width=50%><input type=text name=nickname style=width:100%>
</td>
</tr>
<tr>
&LT;TD width=20%> Email:
</td>
&LT;TD width=50%><input type=text Name=email style=width:100%>
</td>
</tr>
<tr >
&LT;TD width=20%> Message:<br><br><br>
</td>
&LT;TD width=80%> <textarea name=notes cols= "" rows= "5" ></textarea>
</td>
</tr>
<tr>
&LT;TD width=20%> </td>
&LT;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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ", $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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.