一个个人网页自动化生成系统(3)
Release: 2016-06-21 09:02:46
Original
1469 people have browsed it
单页生成,文件名:shengcheng.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 = "
作者:$zuozhe 来源:$laiyuan 时间:$t |
";
$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 "
递交成功
";
?>
继续递交管理文件
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
-
2024-10-22 09:46:29
-
2024-10-13 13:53:41
-
2024-10-12 12:15:51
-
2024-10-11 22:47:31
-
2024-10-11 19:36:51
-
2024-10-11 15:50:41
-
2024-10-11 15:07:41
-
2024-10-11 14:21:21
-
2024-10-11 12:59:11
-
2024-10-11 12:17:31