SHARE
TWEET

Untitled

a guest Jul 19th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $style = "include/style.php";
  3. $js = "include/js.php";
  4.  
  5. $dom = new DOMDocument;
  6. $dom->loadHTMLFile('/home/kiwi/public_html/index.html');
  7.  
  8. $head = $dom->getElementsByTagName('head')->item(0);
  9. $css = $head->getElementsByTagName("link")->item(1);
  10. $fh = fopen($style, 'w');
  11. $data = "<link href=".$css->getAttribute("href")." rel=stylesheet>";
  12. fwrite($fh, $data);
  13. fclose($fh);
  14.  
  15. $body = $dom->getElementsByTagName('body')->item(0);
  16. $scripts = $body->getElementsByTagName("script");
  17. $fh = fopen($js, 'w');
  18. $data = "";
  19. foreach($scripts as $s) {
  20.         $data .="<script type=text/javascript src=".$s->getAttribute("src")."></script>";
  21. }
  22. fwrite($fh, $data);
  23. fclose($fh);
  24. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top