来源:自学PHP网 时间:2014-12-25 09:56 作者: 阅读:次
[导读] 一个个人网页自动化生成系统(3),单页生成,文件名:shengcheng.phplt;htmlgt;lt;bodybackground=quot;image/b-graingr1.jpgquot;gt;lt;?php$db=MySQL_connectquot;localhostquot;,quot;rootquot;;mysql_select_dbquot;studyquot;,$d...
单页生成,文件名:shengcheng.php
<html> <body background="image/b-graingr1.jpg"> <?php $db = MySQL_connect("localhost", "root"); mysql_select_db("study",$db); // 把文章写入数据库 $t = date("Y-m-d h:i:s"); $sql = "INSERT INTO wenzhang (timu,zuozhe,laiyuan,textt,riqi) VALUES ('$timu','$zuozhe','$laiyuan','$textt','$t')"; $result = mysql_query($sql); // 把计数器加一 $fdd=fopen("count.txt","r"); $cdd=fread($fdd,5); $cdd++; fclose($fdd); $fdd=fopen("count.txt","w"); fwrite($fdd,$cdd); fclose($fdd); // 文章生成 $muoban1 = fopen("muoban1.txt","r"); $muoban2 = fopen("muoban2.txt","r"); $muoban3 = fopen("muoban3.txt","r"); $qita = "<p><table width="75%" border="0" align="center"> <tr> <td class=p9> <div align="center">作者:<font color="#306800">$zuozhe</font> 牐犂丛矗<font color="#306800">$laiyuan</font> 牐犑奔洌<font color="#336600">$t</font> </div> </td> </tr> </table></p>"; $muoban4=fread($muoban1,1000); $muoban5=fread($muoban2,1000); $muoban6=fread($muoban3,1000); fclose($muoban1); fclose($muoban2); fclose($muoban3); $main="$muoban4 $timu $qita $muoban5 $textt $muoban6"; // 文章生成 $ttt=".html"; $n=$cdd.$ttt; $f = fopen($n,"a"); fwrite($f,$main); fclose($f); PRint "<center><b>递交成功<br>"; ?> <p><br></p> <p><br></p> <center><a href="input.php">继续递交</a>牐<a href="guanli.php">管理文件</a></center> </body> </html> 【本文版权归作者time2与奥索网共同拥有,如需转载,请注明作者及出处】 |
自学PHP网专注网站建设学习,PHP程序学习,平面设计学习,以及操作系统学习
京ICP备14009008号-1@版权所有www.zixuephp.com
网站声明:本站所有视频,教程都由网友上传,站长收集和分享给大家学习使用,如由牵扯版权问题请联系站长邮箱904561283@qq.com