{"id":558,"date":"2015-10-20T21:56:41","date_gmt":"2015-10-20T13:56:41","guid":{"rendered":"http:\/\/www.yptk.cn\/index.php\/2015\/10\/20\/%e6%89%8b%e5%86%99%e4%bb%a3%e7%a0%81%e5%bb%ba%e4%b8%80%e4%b8%aa%e7%ae%80%e5%8d%95%e7%bd%91%e7%ab%99%e3%80%82\/"},"modified":"2015-10-20T21:56:41","modified_gmt":"2015-10-20T13:56:41","slug":"%e6%89%8b%e5%86%99%e4%bb%a3%e7%a0%81%e5%bb%ba%e4%b8%80%e4%b8%aa%e7%ae%80%e5%8d%95%e7%bd%91%e7%ab%99%e3%80%82","status":"publish","type":"post","link":"http:\/\/yptk.cn\/index.php\/2015\/10\/20\/%e6%89%8b%e5%86%99%e4%bb%a3%e7%a0%81%e5%bb%ba%e4%b8%80%e4%b8%aa%e7%ae%80%e5%8d%95%e7%bd%91%e7%ab%99%e3%80%82\/","title":{"rendered":"\u624b\u5199\u4ee3\u7801\u5efa\u4e00\u4e2a\u7b80\u5355\u7f51\u7ad9\u3002"},"content":{"rendered":"<p>\u4e0b\u9762\u6211\u4eec\u7528\u521a\u4ecb\u7ecd\u8fc7\u7684html\u3001css\u3001php\u3001mysql\u6765\u505a\u4e00\u4e2a\u7b80\u5355\u7684\u52a8\u6001\u7f51\u7ad9\u3002\u5916\u89c2\u5982\u4e0b\uff1a<br \/>\n<img decoding=\"async\" src=\"http:\/\/www.yptk.cn\/wp-content\/uploads\/2015\/11\/thum-bec41446376792.jpg\" title=\"\u70b9\u51fb\u67e5\u770b\u539f\u56fe\" alt=\"ea031445349426.jpg\" border=\"0\" width=\"100%\" \/><br \/>\n\u90a3\u4e48\u6211\u4eec\u7684\u601d\u8def\u662f\u8fd9\u6837\u7684\u3002\u7f51\u7ad9\u4e3b\u8981\u662f\u4e09\u90e8\u5206\u3002<br \/>\nindex.php\uff1a\u4e3b\u9875\u9762\uff0c\u5b9e\u73b0\u6570\u636e\u7684\u6dfb\u52a0\u3001\u67e5\u8be2\u3002\u6837\u5f0f\u8868\u548c\u6570\u636e\u5e93\u7684\u94fe\u63a5\u3002<br \/>\nstyle.css\uff1a\u63a7\u5236\u9875\u9762\u6837\u5f0f\uff0c\u5b9e\u73b0\u81ea\u9002\u5e94\u3002<br \/>\nmysql\u6570\u636e\u5e93\uff1a\u6309\u5b58\u50a8\u9700\u6c42\u6dfb\u52a0\u6570\u636e\u8868\u3002<br \/>\n\u76f8\u4fe1\u5927\u90e8\u5206\u4ee3\u7801\u5927\u5bb6\u90fd\u80fd\u770b\u61c2\u6211\u5c31\u4e0d\u8d58\u8ff0\u4e86\u3002<br \/>\nindex.php\u5185\u7684\u4ee3\u7801\u5982\u4e0b\uff0c\u94fe\u63a5\u6570\u636e\u5e93\u90e8\u5206\u6211\u5df2\u7ecf\u505a\u4e86\u6ce8\u91ca\uff1a<\/p>\n<pre class=\"prettyprint lang-php linenums\">&lt;html&gt;\n&lt;head&gt;\n    &lt;meta charset=\"utf-8\"&gt;\n\t&lt;link rel=\"stylesheet\" type=\"text\/css\" media=\"screen\" href=\".\/style.css\" \/&gt;\n\t&lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" \/&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n&lt;center&gt;\n&lt;div class=\"wrapper\"&gt;\n  &lt;div class=\"box1\"&gt;\n\t   &lt;h1&gt;YPTK&lt;\/h1&gt;\n       &lt;span&gt;sense and simplicity&lt;\/span&gt;\n  &lt;\/div&gt;\n  &lt;div&gt;\n    &lt;div&gt;\n       &lt;form method=\"post\" action=\"\"&gt;\n       &lt;textarea name=\"liuyan\" rows=\"6\"&gt;&lt;\/textarea&gt;\n    &lt;\/div&gt;\n    &lt;div class=\"box2\"&gt;\n      &lt;div class=\"\"&gt;\n      &lt;input type=\"text\" name=\"name\" value=\"\"&gt;\n      &lt;\/div&gt;\n      &lt;div class=\"btn\"&gt;\n      &lt;input type=\"submit\" name=\"sub\" value=\"Submit\"&gt;\n\t  &lt;\/form&gt;\n      &lt;\/div&gt;\n    &lt;\/div&gt;\n  &lt;\/div&gt;\n  &lt;div class=\"box2\"&gt;\n &lt;?php\n    $link = mysql_connect('localhost','root','root');\/\/\u94fe\u63a5\u6570\u636e\u5e93\u670d\u52a1\u5668\n    mysql_select_db('yptk');\/\/\u9009\u62e9\u6570\u636e\u5e93\n    mysql_set_charset('utf8');\/\/\u5b9a\u4e49\u5b57\u7b26\u96c6\u7f16\u7801\n\tif(isset($_POST['sub'])){\n\t$name = $_POST['name'];\/\/\u5f97\u5230\u7528\u6237\u63d0\u4ea4\u7684\u5185\u5bb9\n\t$liuyan= $_POST['liuyan'];\n\t($liuyan=='') and die('\u8bf7\u8f93\u5165\u7559\u8a00\u5185\u5bb9');\n\t($name=='') and die('\u8bf7\u8f93\u5165\u59d3\u540d');\n\t$time=date(\"M jS Y, l H:i\");\n\t$sql_1 = \"INSERT INTO user(name,text,time) values('$name','$liuyan','$time')\";\n\t$res_1 = mysql_query($sql_1);}\n    $sql = \"SELECT name,text,time FROM user ORDER BY id desc\";\/\/\u9009\u62e9\u6570\u636e\n    $res = mysql_query($sql);\/\/\u53d1\u9001\u6267\u884c\n?&gt;\n&lt;?php\n    while(list($name,$liuyan,$time) = mysql_fetch_row($res)){\/\/\u83b7\u53d6\u7d22\u5f15\u6570\u7ec4\uff0c\u5c06\u503c\u8d4b\u7ed9list\uff08\uff09\n\t\techo \"&lt;div class=post&gt;&lt;div class=time&gt;{$time}&lt;\/div&gt;&lt;div class=name&gt;{$name}:&lt;\/div&gt;&lt;div&gt;{$liuyan}&lt;\/div&gt;&lt;\/div&gt;\"; \/\/\u6253\u5370\u7ed3\u679c\n    }\n?&gt;\n&lt;p&gt;2015&copy;YPTK.CN&lt;\/p&gt;\n  &lt;\/div&gt;\n&lt;\/div&gt;\n&lt;\/center&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/pre>\n<p>style.css\u7684\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre class=\"prettyprint lang-css linenums\">body {font-size: 1.2em;font-family:times,Arial,serif;}\n*{margin-top:5px}\nh1{color:#69b40f}\nspan{color:#fff}\n.wrapper{width: 100%;}\ntextarea {padding:2pt;border: 1px solid #000000;width: 50%;font-size:1.2em;}\n.box1{width:50%;padding-top:20px;padding-bottom:10px;background-image:url(.\/img\/bg.png);background-color:#333;text-align:center;}\n.box2{width:50%}\n.name{color:#69b40f;font-size:1.4em}\n.post {clear:left;border-bottom: 1px solid #000000;padding-bottom: 10px;width: 100%;margin: 10px auto;text-align:left;overflow:hidden;}\n.time{font-size: .8em;padding: 2px 6px;text-align: center;float: right;border: 1px solid;border-radius: 8px;width: 60px;}\ninput[type=\"text\"]{margin:6px 0;padding: 2pt;border: 1px solid #000000;width: 49%;font-size:1.2em;float:left}\ninput[type=\"submit\"]{margin: 6px 0;font-size:1.2em;width:49%;float:right}\n@media screen and (max-width: 800px){\ntextarea {width:100%;height: auto;}\n.post,.box2,.box1{width: 100%;}\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u4e0b\u9762\u6211\u4eec\u7528\u521a\u4ecb\u7ecd\u8fc7\u7684html\u3001css\u3001php\u3001mysql\u6765\u505a\u4e00\u4e2a\u7b80\u5355\u7684\u52a8\u6001\u7f51\u7ad9\u3002\u5916\u89c2\u5982\u4e0b\uff1a \u90a3\u4e48\u6211\u4eec\u7684\u601d\u8def\u662f\u8fd9\u6837\u7684\u3002\u7f51\u7ad9\u4e3b\u8981\u662f\u4e09\u90e8\u5206\u3002 index.php\uff1a\u4e3b\u9875\u9762\uff0c\u5b9e\u73b0\u6570\u636e\u7684\u6dfb\u52a0\u3001\u67e5\u8be2\u3002\u6837\u5f0f\u8868\u548c\u6570\u636e\u5e93\u7684\u94fe\u63a5\u3002 style.css\uff1a\u63a7\u5236\u9875\u9762\u6837\u5f0f\uff0c\u5b9e\u73b0\u81ea\u9002\u5e94\u3002 mysql\u6570\u636e\u5e93\uff1a\u6309\u5b58\u50a8\u9700\u6c42\u6dfb\u52a0\u6570\u636e\u8868\u3002 \u76f8\u4fe1\u5927\u90e8\u5206\u4ee3\u7801\u5927\u5bb6\u90fd\u80fd\u770b\u61c2\u6211\u5c31\u4e0d\u8d58\u8ff0\u4e86\u3002 index.php\u5185\u7684\u4ee3\u7801\u5982\u4e0b\uff0c\u94fe\u63a5\u6570\u636e\u5e93\u90e8\u5206\u6211\u5df2\u7ecf\u505a\u4e86\u6ce8 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[15],"tags":[],"class_list":["post-558","post","type-post","status-publish","format-standard","hentry","category-15"],"_links":{"self":[{"href":"http:\/\/yptk.cn\/index.php\/wp-json\/wp\/v2\/posts\/558","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/yptk.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/yptk.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/yptk.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/yptk.cn\/index.php\/wp-json\/wp\/v2\/comments?post=558"}],"version-history":[{"count":0,"href":"http:\/\/yptk.cn\/index.php\/wp-json\/wp\/v2\/posts\/558\/revisions"}],"wp:attachment":[{"href":"http:\/\/yptk.cn\/index.php\/wp-json\/wp\/v2\/media?parent=558"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/yptk.cn\/index.php\/wp-json\/wp\/v2\/categories?post=558"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/yptk.cn\/index.php\/wp-json\/wp\/v2\/tags?post=558"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}