A personal web page Automation Generation system (6)
Last Update:2017-02-28
Source: Internet
Author: User
Website administration, FileName: guanli.php
<title>untitled document</title>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<body bgcolor= "#FFFFFF" background= "image/b-graingr2.jpg" >
<table width= "775" border= "0" >
<tr>
<TD width= "height=" 463 "valign=" Top ">
<p></p>
<p></p>
<p><a href= "muban.php" ></a></p>
<p></p>
<p></p>
<p></p>
<p></p>
</td>
<TD width= "663" height= "463" valign= "Top" >
<table width= "0" border= "align=" center "height=" 234 ">
<tr>
<TD height= ">"
<div align= "center" ><b><font color= "#480000" size= "6" > Page management </font></b></div>
</td>
</tr>
<TR valign= "Top" >
<TD height= "267" >
<?php
Program start
$db = mysql_connect ("localhost", "root");
mysql_select_db ("study", $db);
Judge whether or not to modify the file
if ($submit) {
$sql = "UPDATE wenzhang SET timu= ' $timu ', zuozhe= ' $zuozhe ',
Laiyuan= ' $laiyuan ', textt= ' $textt ' WHERE id= $id ';
To issue 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 = "<p><table width=" 75% "border=" 0 "align=" center ">
<tr>
<TD class=p9>
<div align= "center" > Author: <font color= "#306800" > $zuozhe </font><td width= "154" height= "a" >
<input type= "text" name= "Zuozhe" value= "$zuozhe" size= ">"
</td>
<TD width= "height=" > Source:</td>
<TD width= "456" height= ">"
<input type= "text" name= "Laiyuan" value= "$laiyuan" size= ">"
</td>
</tr>
<tr>
<TD width= ":</td>" > Body
<TD colspan= "3" >
<textarea name= "Textt" cols= "rows=" > $textt </textarea>
</td>
</tr>
<tr>
<TD width= "> </td>"
<TD colspan= "3" >
<input type= "Submit" name= "submit" value= "Input Info" >
</td>
</tr>
</table>
</form> ";
echo $FOM 1;
}
if (! $id) {
If the status is not modified, the list of employees is displayed
$result = mysql_query ("SELECT * from Wenzhang", $db);
printf ("<ul>");
while ($myrow = Mysql_fetch_array ($result)) {
printf ("<li><a href="%s.html ">%s</a> n",
$myrow ["id"], $myrow ["Timu"]);
printf ("<a href="%s?id=%s "> (Modify) </a><br></li>", $PATH _info, $myrow ["id"]);
}
printf ("</ul>"); }
End of program
?>
</td>
</tr>
<tr>
<TD height= ">"
<div align= "right" ><a href= "input.php" ></a></div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>