Nextrek
@ 767
Nextrek / legal-map / ajax / openArticle.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
<?php if (file_exists(dirname(__FILE__)."/../articoli/".$_REQUEST["html"])) { $d = new DOMDocument; $mock = new DOMDocument; $d->loadHTML(file_get_contents(dirname(__FILE__)."/../articoli/".$_REQUEST["html"])); $body = $d->getElementsByTagName('body')->item(0); foreach ($body->childNodes as $child){ $mock->appendChild($mock->importNode($child, true)); } echo $mock->saveHTML(); } else { header($_SERVER['SERVER_PROTOCOL'] . ' 404 File Not Found', true, 404); echo "<b>File Not Found</b>"; } ?> |