This is supposed to remove all the code between the script tags, and between the style tags, It doesn’t seem to be working.
$source is what is supposed to remove the script, and style.
[code=php]<?php
$html = file_get_contents(trim($_POST[“url”]));
if($html !== FALSE){
if(preg_match(‘/<body[^>]*>(.*)</body>/is’, $html, $matches)){
$source = /*addslashes(strip_tags(*/preg_replace(‘/<script.*.script>/’, ‘ ‘, $matches[0])/*))*/.”n”;
$source = /*addslashes(strip_tags(*/preg_replace(‘/<style.*.style>/’, ‘ ‘, $matches[1])/*))*/.”n”;
}else{
echo “<p>No match found</p>n”;
$source = ‘ ‘;
}
}else{
echo “<p>Unable to get html from site.</p>n”;
}
?>