A personal web Automation generation System (3) _php tutorial

Source: Internet
Author: User
Tags fread
Website management, file name: guanli.php


<title>Untitled Document</title>



























Page Management



Program start
$db = mysql_connect ("localhost", "root");

mysql_select_db ("study", $db);
Determine if the file is modified
if ($submit) {

$sql = "UPDATE wenzhang SET timu= $timu, zuozhe= $zuozhe,
laiyuan= $laiyuan, textt= $textt WHERE id= $id ";



Issuing SQL commands to the database

$result = mysql_query ($sql);
Article generation
$t = Date ("y-m-d h:i:s");
$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 = $id. $ttt;
$f = fopen ($n, "w");
Fwrite ($f, $main);
Fclose ($f);

echo "Record modified successfully!"

";


}

Do we enter edit modify state
if ($id) {


We are editing the modified state, because some select a record

$sql = "SELECT * from Wenzhang WHERE id= $id";

$result = mysql_query ($sql);

$myrow = Mysql_fetch_array ($result);

$id = $myrow ["id"];

$timu = $myrow ["Timu"];

$zuozhe = $myrow ["Zuozhe"];

$laiyuan = $myrow ["Laiyuan"];

$TEXTT = $myrow ["Textt"];


Display ID for users to edit and modify


$fom 1 = "";
echo $FOM 1;
}
if (! $id) {


If the status is not modified, the employee list is displayed

$result = mysql_query ("SELECT * from Wenzhang", $db);
printf ("

      ");
      while ($myrow = Mysql_fetch_array ($result)) {

      printf ("

    • %s N ",
      $myrow ["id"], $myrow ["Timu"]);

      printf ("(modified)

    • ", $PATH _info, $myrow [" id "]);

      }
      printf ("

"); }
End of program
?>







http://www.bkjia.com/PHPjc/532497.html www.bkjia.com true http://www.bkjia.com/PHPjc/532497.html techarticle website Management, file name: guanli.php HTML head titleuntitled document/title meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/head body bgcolor=" #FFFFFF "Backgrou ...

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