I am using a simple HTML parser. Everything works well with my code, but jqueryui does not work, and for some sites it does not display images. Please check live here and try using a simple HTML parser .
Enter the URL in the text box with the URL. You can see that the images are not loaded, and the sliders do not work. Here is my code
<?php include_once 'simple_html_dom.php'; $data = new simple_html_dom(); if ( isset($_REQUEST['url_name']) ) { if ( strpos($_REQUEST['url_name'], "http://") === false && strpos($_REQUEST['url_name'], "//") === false ) { $_REQUEST['url_name']="http://".$_REQUEST['url_name']; } $url_name = $_REQUEST['url_name']; if ( strpos($_REQUEST['url_name'], "/") === false ) { $url_name = $_REQUEST['url_name'].'/'; } // Load HTML from an URL $data->load_file($_REQUEST['url_name']); foreach ( $data->find('img') as $element ) { $element->target='_blank'; if ( strpos($element, ".com") === false && strpos($element, ".net") === false && strpos($element, ".org") === false && strpos($element, "http://") === false && strpos($element, "https://") === false ){ $element->src=$url_name.$element->src; } } foreach ( $data->find('style') as $element ) { if ( strpos($element, ".com") === false && strpos($element, ".net") === false && strpos($element, ".org") === false && strpos($element, "http://") === false && strpos($element, "https://") === false ){ $element->src=$url_name.$element->src; } } foreach ( $data->find('script') as $element ) { if ( strpos($element, ".com") === false && strpos($element, ".net") === false && strpos($element, ".org") === false && strpos($element, "http://") === false && strpos($element, "https://") === false ){ $element->src=$url_name.$element->src; } } foreach ( $data->find('link') as $element ) { if ( strpos($element, ".com") === false && strpos($element, ".net") === false && strpos($element, ".org") === false && strpos($element, "http://") === false && strpos($element, "https://") === false ){ $element->href=$url_name.$element->href; } } foreach ( $data->find('a') as $element ) { if ( strpos($element->href, ".com") === false && strpos($element->href, ".net") === false && strpos($element->href, ".org") === false && strpos($element->href, "http://") === false && strpos($element->href, "https://") === false ){ $element->href = "form_submit.php?url_name=".$url_name.$element->href; } else { $element->href = "form_submit.php?url_name=".$element->href; } } echo $newHtml; } ?>
source share