I use simplehtmldom for parsing a website to get all images.
Everytime i add a link the error occurs:
Fatal error: Call to a member function find() on a non-object
Code:
<form method="post">
Link <input type="text" name="link" size="50"/>
<input type="submit" />
</form>
<?php
if($link != "")
{
include_once('simple_html_dom.php');
$html = $_POST[link]
// Find all images
foreach($html->find('img') as $element)
{
echo $element->src . '<br>';
}
}
?>
TestSite:
http://simplehtmldom.sourceforge.net/
You must use constructor for its member functions
$html = file_get_html($_POST['link']);$html = $_POST['link']String$html = file_get_html($_POST['link']);Class