<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>
<?php
$lianjie = mysql_connect ("localhost", "root", "Xiaolie") or Die ("Connection failed");
mysql_query ("Set names UTF8");
if (@$_post["OK"])
{
mysql_select_db ("Xiaolie");
Inserting data
$shuju = "INSERT into Hao (Name,neirong,shijian) VALUES ('". $_post["Name"]. "', '". $_post["Neirong"]. Date ("Y-m-d H : "M:s");
$fasong = mysql_query ($shuju) or Die (Mysql_error ());
if ($fasong)
{
Header ("location:/a2/ly.php");
}
Else
{
echo "Content publishing failed <br><a href=fb_my.php> return </a>";
}
}
Else
{
/* mysql_select_db ("Xiaolie");
Send a query
$fasong = mysql_query ("select * from Hao") or Die (Mysql_error ());
while ($nr = Mysql_fetch_array ($fasong))
{
echo "<table border=1>
<tr>
<TD width= ' > '. $nr [id]. "Building </td>
<TD width= ' 140 ' > Published User: ". $nr [" name]. " </td>
<TD width= ' 230 ' > Publication time: ". $nr [" Shijian "]." </td>
</tr>
<TR><TD colspan= ' 3 ' width= ' 430 ' > '. $nr ["Neirong"]. " </td></tr>
</table> ";
}
*/
?>
<form Method=post action=fb_my.php>
Name <input type=text name= "name"/><br>
Published <br><textarea name= "Neirong" cols= "rows=" 5 "></textarea><br>
<input type=submit name= "OK" value= "OK"/>
</form>
<?php
}
?>