PHP: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title></title> </head> <body> <?php $username=$_POST['uname']; $qqhao=$_POST['qhao']; $mail=$_POST['ehao']; $textcontent=$_POST['information']; $d=date("Y-m-D H:i:s A"); $filename="data_book.txt"; $testcontent=$username."/".$qqhao."/".$mail."/".$textcontent."/".$d."\n"; $f=fopen ($filename,"a+"); fwrite ($f,$testcontent); fclose ($f); ?> <table width="233" height="89" border="1" align="center" cellpadding="0" cellspacing="0"> <?php $f1=file ("data_book.txt");/*这里要新建一个文本文件*/ foreach ($f1 as $b1){ $i=0; $i+=1; $kk= explode("/",$b1); ?> <tr> <td width="71" rowspan="2">姓名:<?php echo $kk[0]; ?></td> <td width="123">QQ:<?php echo $kk[1]; ?></td> </tr> <tr> <td>E-mail:<?php echo $kk[2]; ?></td> </tr> <tr> <td colspan="2">内容:<?php echo $kk[3]; ?><br></td> </tr> <tr> <td>编辑日期:<?php echo $kk[4]; ?></td> <td><div align="right">第<?php echo $i;?>楼</div></td> </tr> <?php } ?> </table> <br> <hr color="#FF0000" align="center" size="1"> <br> <form action="php_note_books.php" method="post" name="form1" target="_self"> <table width="272" border="1" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="62">姓名:</td> <td width="204"><input name="uname" type="text" id="uname" maxlength="18"></td> </tr> <tr> <td>QQ:</td> <td><input name="qhao" type="text" id="qhao" maxlength="9"></td> </tr> <tr> <td>mail:</td> <td><input name="ehao" type="text" id="ehao" maxlength="25"></td> </tr> <tr> <td>编辑内容:</td> <td><textarea name="information" cols="60" rows="30" id="information"></textarea></td> </tr> <tr> <td colspan="2"><div align="center"> <input type="submit" name="Submit" value="提交"> <input type="reset" name="Submit" value="重置"> </div></td> </tr> </table> </form> </body> </html>