{"id":452,"date":"2016-12-20T19:41:54","date_gmt":"2016-12-20T10:41:54","guid":{"rendered":"http:\/\/okamurax.com\/?p=452"},"modified":"2016-12-23T10:18:21","modified_gmt":"2016-12-23T01:18:21","slug":"php-ip%e3%82%a2%e3%83%89%e3%83%ac%e3%82%b9%e7%a2%ba%e8%aa%8d%e7%94%a8post","status":"publish","type":"post","link":"https:\/\/appbay.org\/?p=452","title":{"rendered":"PHP IP\u30a2\u30c9\u30ec\u30b9\u78ba\u8a8d\u7528POST"},"content":{"rendered":"<p>\u30af\u30e9\u30a4\u30a2\u30f3\u30c8<\/p>\n<pre class=\"lang:c# decode:true\">using System;\r\nusing System.Collections.Generic;\r\nusing System.ComponentModel;\r\nusing System.Data;\r\nusing System.Drawing;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\nusing System.Windows.Forms;\r\n\r\nusing System.IO;\r\n\/\/\u53c2\u7167\u8a2d\u5b9a Microsoft XML, v6.0\r\nusing MSXML2;\r\n\r\nnamespace Post_Db\r\n{\r\n    public partial class Form1 : Form\r\n    {\r\n        private string DoPost()\r\n        {\r\n            XMLHTTP xh = new XMLHTTP();\r\n            string param = @\"&amp;key=xxx&amp;name=\" + Environment.MachineName;\r\n            xh.open(\"POST\", \"http:\/\/xxx\/post.php\", false);\r\n            xh.setRequestHeader(\"Content-Type\", \"application\/x-www-form-urlencoded\");\r\n            xh.send(param);\r\n            return xh.responseText;\r\n        }\r\n\r\n        public Form1()\r\n        {\r\n            InitializeComponent();\r\n            DoPost();\r\n        }\r\n    }\r\n}\r\n\r\n<\/pre>\n<p>\u3042\u308b\u3044\u306f\u3001<\/p>\n<pre class=\"lang:ruby decode:true\">require 'net\/http'\r\nres = Net::HTTP.post_form(URI.parse('http:\/\/xxx.com\/post.php'),\r\n{'key'=&gt;'xxx'})\r\n<\/pre>\n<p>Win\u306a\u3089\u30bf\u30b9\u30af\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u3001ubuntu\u306a\u3089<a href=\"http:\/\/okamurax.com\/?p=363\">CRON<\/a>\u306b\u8a2d\u5b9a\u3057\u3066\u304a\u304f\u3068\u3001<br \/>\n\u5b9a\u671f\u7684\u306bWan\u5074\u306eIP\u304c\u30ec\u30f3\u30b5\u30d0\u306b\u8868\u793a\u3067\u304d\u308b\u306e\u3067\u3001\u305d\u306eWan\u5074\u306eIP\u3092\u4f7f\u3063\u3066\u3001<br \/>\n<a href=\"http:\/\/okamurax.com\/?p=472\">SoftEther<\/a>\u3092\u30c0\u30a4\u30ca\u30df\u30c3\u30afDNS\u3067\u306f\u306a\u304f\u3001IP\u76f4\u6253\u3061\u3082\u3067\u304d\u308b\u3002<br \/>\nxxx.xxx.xxx.xxx\/192.168.xxx.xxx\u306e\u3088\u3046\u306a\u611f\u3058\u3067\u5165\u529b\u3059\u308b\u3002<\/p>\n<p>post.php<\/p>\n<pre class=\"lang:php decode:true \">&lt;?php\r\nini_set(\"display_errors\",\"On\");\r\nini_set(\"error_reporting\",E_ALL);\r\nclass App{\r\n\tprivate function main(){\r\n\t\tif(array_key_exists(\"key\",$_POST) &amp;&amp; $_POST[\"key\"] == \"xxx\"){\r\n\t\t\t$current = file_get_contents(\"_index.html\");\r\n\t\t\t $current = \"Name:\" . $_POST[\"name\"] . \" \/ Date:\" . date(\"Y\/m\/d H:i:s\") . \"\r\n\" . $current;\r\n\t\t\tfile_put_contents(\"_index.html\", $current);\r\n\t\t}\r\n\t}\r\n\tpublic function __construct(){\r\n\t\t$this-&gt;main();\r\n\t}\r\n}\r\nnew App;\r\n\r\n<\/pre>\n<p>s.css<\/p>\n<pre class=\"lang:css decode:true \">*{font-size:18px;}\r\na{text-decoration:none;}\r\n@media screen and (max-device-width: 480px) {\r\n*{font-size:32px;}\r\na{font-size:64px;}\r\n}\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u30af\u30e9\u30a4\u30a2\u30f3\u30c8 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using S &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/appbay.org\/?p=452\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;PHP IP\u30a2\u30c9\u30ec\u30b9\u78ba\u8a8d\u7528POST&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[9,3],"class_list":["post-452","post","type-post","status-publish","format-standard","hentry","category-1","tag-c-net","tag-php"],"_links":{"self":[{"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/452","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=452"}],"version-history":[{"count":6,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/452\/revisions"}],"predecessor-version":[{"id":504,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/452\/revisions\/504"}],"wp:attachment":[{"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=452"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=452"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=452"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}