{"id":1004,"date":"2011-01-31T17:09:14","date_gmt":"2011-01-31T10:09:14","guid":{"rendered":"http:\/\/www.icez.net\/blog\/?p=1004"},"modified":"2011-01-31T17:40:32","modified_gmt":"2011-01-31T10:40:32","slug":"0115-multipart-page-generator","status":"publish","type":"post","link":"https:\/\/www.icez.net\/blog\/1004\/0115-multipart-page-generator","title":{"rendered":"0115 | Multipart Page Generator"},"content":{"rendered":"<p>\u0e40\u0e17\u0e04\u0e19\u0e34\u0e04\u0e19\u0e35\u0e49\u0e40\u0e2d\u0e32\u0e21\u0e32\u0e08\u0e32\u0e01 facebook \u0e2e\u0e30 :) \u0e41\u0e2b\u0e25\u0e48\u0e21\u0e14\u0e35 \u0e04\u0e34\u0e14\u0e44\u0e14\u0e49\u0e44\u0e07 \u0e19\u0e31\u0e1a\u0e16\u0e37\u0e2d\u0e21\u0e32\u0e01<br \/>\n\u0e08\u0e23\u0e34\u0e07\u0e46 \u0e02\u0e2d\u0e07 fb \u0e40\u0e02\u0e35\u0e22\u0e19\u0e14\u0e35\u0e01\u0e27\u0e48\u0e32\u0e19\u0e35\u0e49\u0e40\u0e22\u0e2d\u0e30 \u0e19\u0e35\u0e48 implement \u0e41\u0e1a\u0e1a\u0e25\u0e27\u0e01\u0e46 \u0e2a\u0e38\u0e14\u0e22\u0e2d\u0e14<\/p>\n<p><!--more--><\/p>\n<p>\u0e2d\u0e31\u0e19\u0e19\u0e35\u0e49\u0e2b\u0e19\u0e49\u0e32 index.php<\/p>\n<pre lang=\"php\">\r\n<!DOCTYPE html>\r\n<html>\r\n<head>\r\n<title>Multipart Page Generator Framework<\/title>\r\n<meta http-equiv=\"content-type\" content=\"text\/html; charset=UTF-8\" \/>\r\n<style type=\"text\/css\">\r\nbody{margin:0;padding:0;font:10pt Tahoma;}\r\ndiv{margin:5px;padding:5px;border:1px dotted #aaf;}\r\ndiv.c{text-align:center;}\r\n#wrapper{width:990px;margin:0 auto;border:0;padding:0;}\r\n<\/style>\r\n<script type=\"text\/javascript\">\r\nfunction mppg_returncontent(id, content) {\r\ndocument.getElementById(id).innerHTML = content;\r\n}\r\n<\/script>\r\n<\/head>\r\n<body>\r\n\r\n<div id=\"wrapper\">\r\n\r\n<div id=\"command\"><\/div>\r\n\r\n<div id=\"status\"><\/div>\r\n\r\n<\/div>\r\n\r\n<?php\r\nflush();\r\n$urls = array('http:\/\/localhost\/command.php', 'http:\/\/localhost\/status.php');\r\n$curl_arr = array();\r\n$master = curl_multi_init();\r\nforeach($urls as $id => $url) {\r\n\t$curl_arr[$id] = curl_init($url);\r\n\tcurl_multi_add_handle($master, $curl_arr[$id]);\r\n}\r\n\r\n$running = 0;\r\n$lastrun = 0;\r\ndo{\r\n\tcurl_multi_exec($master,$running);\r\n\t\/\/$info = curl_multi_info_read($master);\r\n\tflush();\r\n\tusleep(5000);\r\n} while ($running > 0);\r\n\r\n\/\/close the handles\r\nforeach($urls as $id => $url) {\r\n\tcurl_multi_remove_handle($master, $curl_arr[$id]);\r\n}\r\ncurl_multi_close($master);\r\n?>\r\n<\/body>\r\n<\/html>\r\n<\/pre>\n<p>\u0e2a\u0e48\u0e27\u0e19\u0e2d\u0e31\u0e19\u0e19\u0e35\u0e49 prepend \u0e41\u0e1b\u0e30\u0e2b\u0e19\u0e49\u0e32\u0e22\u0e48\u0e2d\u0e22\u0e02\u0e49\u0e32\u0e07\u0e43\u0e19<\/p>\n<pre lang=\"php\">\r\n<?php\r\n$partid = 'command';\r\nfunction mppg_returncontent($buffer) {\r\nglobal $partid;\r\nreturn '<script type=\"text\/javascript\">\r\nmppg_returncontent(\"'.$partid.'\", \"'.addslashes(str_replace(array(\"\\n\",\"\\r\"), '', $buffer)).'\");\r\n<\/script>';\r\n}\r\nob_start('mppg_returncontent');\r\n?>content here\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u0e40\u0e17\u0e04\u0e19\u0e34\u0e04\u0e19\u0e35\u0e49\u0e40\u0e2d\u0e32\u0e21\u0e32\u0e08\u0e32\u0e01 facebook \u0e2e\u0e30 :) \u0e41\u0e2b\u0e25\u0e48\u0e21\u0e14\u0e35 \u0e04\u0e34\u0e14\u0e44\u0e14\u0e49\u0e44\u0e07 \u0e19\u0e31\u0e1a\u0e16\u0e37\u0e2d\u0e21\u0e32\u0e01 \u0e08\u0e23\u0e34\u0e07\u0e46 \u0e02\u0e2d\u0e07 fb \u0e40\u0e02\u0e35\u0e22\u0e19\u0e14\u0e35\u0e01\u0e27\u0e48\u0e32\u0e19\u0e35\u0e49\u0e40\u0e22\u0e2d\u0e30 \u0e19\u0e35\u0e48 implement \u0e41\u0e1a\u0e1a\u0e25\u0e27\u0e01\u0e46 \u0e2a\u0e38\u0e14\u0e22\u0e2d\u0e14<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1004","post","type-post","status-publish","format-standard","hentry","category-misc"],"_links":{"self":[{"href":"https:\/\/www.icez.net\/blog\/wp-json\/wp\/v2\/posts\/1004","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.icez.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.icez.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.icez.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.icez.net\/blog\/wp-json\/wp\/v2\/comments?post=1004"}],"version-history":[{"count":3,"href":"https:\/\/www.icez.net\/blog\/wp-json\/wp\/v2\/posts\/1004\/revisions"}],"predecessor-version":[{"id":1007,"href":"https:\/\/www.icez.net\/blog\/wp-json\/wp\/v2\/posts\/1004\/revisions\/1007"}],"wp:attachment":[{"href":"https:\/\/www.icez.net\/blog\/wp-json\/wp\/v2\/media?parent=1004"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.icez.net\/blog\/wp-json\/wp\/v2\/categories?post=1004"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.icez.net\/blog\/wp-json\/wp\/v2\/tags?post=1004"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}