Home > Backend Development > PHP Tutorial > A personal web page automatic generation system 3_PHP tutorial

A personal web page automatic generation system 3_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 17:27:38
Original
868 people have browsed it

Single page generation, file name: shengcheng.php


$db = mysql_connect("localhost", "root");
mysql_select_db( "study",$db);
// Write the article into the database
$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);
// Increase the counter by one
$fdd=fopen("count.txt","r");
$cdd=fread($fdd,5);
$cdd++;
fclose($fdd);
$fdd=fopen("count.txt","w");
fwrite($fdd,$cdd);
fclose($fdd);
// Article generation
$muoban1 = fopen("muoban1.txt","r");
$muoban2 = fopen("muoban2.txt","r");
$muoban3 = fopen("muoban3.txt","r" );
$qita = "


Author: $zuozhe Source: $laiyuan

Time: $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";
// Article generation
$ttt=".html";
$n=$cdd.$ttt;
$f = fopen($n, "a");
fwrite($f,$main);
fclose($f);
print "
Submitted successfully
";
?>
Continue to submit the  management documents



[The copyright of this article is jointly owned by the author time2 and Oso.com. If you need to reprint, please indicate the author and source]

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/531854.htmlTechArticleSingle page generation, file name: shengcheng.php $db = mysql_connect(localhost, root); mysql_select_db(study, $db); // Write the article into the database $t = date(Y-m-d h:i:s); $sql = INSERT INTO w...
source:php.cn
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 Issues
Why does it still jump after returning false?
From 1970-01-01 08:00:00
0
0
0
Optimize table indexes in MySQL
From 1970-01-01 08:00:00
0
0
0
Why can't I install it?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template