A personal web page Automated Generation system 1_php Tutorial

Source: Internet
Author: User
Tags fread
Before you want to use this system to create your profile, I believe you have configured the relevant Apache server, MySQL database, and PHP.
Then start your MySQL database, create a database named study, and create a table named Wenzhang.
Create the following fields under phpMyAdmin:
ID smallint (5) No 0 auto_increment
Timu varchar (+) Yes
Zuozhe varchar Yes
Laiyuan varchar (+) Yes
Textt text Yes
Riqi datetime Yes
Single page submission. File name: input.php


<title>Untitled Document</title>






Single page generation, file name: shengcheng.php


$db = mysql_connect ("localhost", "root");
mysql_select_db ("study", $db);
Write the article to 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);
Add the counter to a
$FDD =fopen ("Count.txt", "R");
$CDD =fread ($FDD, 5);
$CDD + +;
Fclose ($FDD);
$FDD =fopen ("Count.txt", "w");
Fwrite ($FDD, $CDD);
Fclose ($FDD);
Article generation
$muoban 1 = fopen ("Muoban1.txt", "R");
$muoban 2 = fopen ("Muoban2.txt", "R");
$muoban 3 = fopen ("Muoban3.txt", "R");
$qita = "

Author: $zuozhe Source: $laiyuan
Date: $t

";
$muoban 4=fread ($muoban 1,1000);
$muoban 5=fread ($muoban 2,1000);
$muoban 6=fread ($muoban 3,1000);
Fclose ($muoban 1);
Fclose ($muoban 2);
Fclose ($muoban 3);
$main = "$muoban 4 $timu $qita $muoban 5 $textt $muoban 6";
Article generation
$TTT = ". html";
$n = $CDD. $ttt;
$f = fopen ($n, "a");
Fwrite ($f, $main);
Fclose ($f);
Print " Submit Success
";
?>


Continue to submit management documents

adjourned

http://www.bkjia.com/PHPjc/531991.html www.bkjia.com true http://www.bkjia.com/PHPjc/531991.html techarticle before you want to use this system to create your profile, I believe you have configured the relevant Apache server, MySQL database, and PHP. Then start your MySQL database ...

  • 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.