Before you create your personal homepage using the system, I believe that you have configured the relevant Apache server, MYSQL database, and php.
Start your mysql database, create a database named study, and create a table named wenzhang.
Create the following fields in phpMyAdmin:
Id smallint (5) No 0 auto_increment
Timu varchar (200) Yes
Zuozhe varchar (18) Yes
Laiyuan varchar (40) Yes
Textt text Yes
Riqi datetime Yes
Submit a single page. File Name: input. php
<Html>
<Head>
<Title> Untitled Document </title>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
</Head>
<Body bgcolor = "# FFFFFF" background = "image/b-graingr1.jpg">
<Form method = "post" action = "shengcheng. php">
<Table width = "750" border = "1" align = "center">
<Tr>
<Td width = "53"> title: </td>
<Td colspan = "3">
<Input type = "text" name = "timu" size = "50">
</Td>
</Tr>
<Tr>
<Td width = "53" height = "28"> author: </td>
& Lt; td width = "154" height = "28" & gt;
<Input type = "text" name = "zuozhe" size = "20">
</Td>
<Td width = "59" height = "28"> Source: </td>
& Lt; td width = "456" height = "28" & gt;
<Input type = "text" name = "laiyuan" size = "30">
</Td>
</Tr>
<Tr>
<Td width = "53"> body: </td>
<Td colspan = "3">
<Textarea name = "textt" cols = "90" rows = "20"> </textarea>
</Td>
</Tr>
<Tr>
<Td width = "53"> </td>
<Td colspan = "3">
<Input type = "submit" name = "Submit" value = "submit">
<Input type = "reset" name = "Submit2" value = "reset">
</Td>
</Tr>
</Table>
</Form>
</Body>
</Html>
Single page generation, file name: shengcheng. php
<Html>
<Body background = "image/b-graingr1.jpg">
<? 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 a counter
$ Fdd = fopen ("count.txt", "r ");
$ Cdd = fread ($ fdd, 5 );
$ Cdd ++;
Fclose ($ fdd );
$ Fdd = fopen ("count.txt", "w ");
Fwrite ($ fdd, $ cdd );
Fclose ($ fdd );
// Document generation
$ 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"> author: <font color = "#306800"> $ zuozhe </font> Source: <font color = "#306800"> $ laiyuan </font>
Time: <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 ";
// Document generation
$ Ttt = ". html ";
$ N = $ cdd. $ ttt;
$ F = fopen ($ n, "");
Fwrite ($ f, $ main );
Fclose ($ f );
Print "<center> <B> submission successful <br> ";
?>
<P> <br> </p>
<P> <br> </p>
<Center> <a href = "input. php"> submit </a> <a href = "guanli. php"> file management </a> </center>
</Body>
</Html>
(To be continued)