<html>
<head>
<?PHP
include('simple_html_dom.php');
?>
<title>
</title>
</head>
<body>
<form name ="form1" method ="POST" ACTION="parser.php">
<input type="text" name="parser1" style="height:200px; width:200pt;"></br></br>
<input type="submit" value="Submit"></br></br>
</form>
<?php
$html_str = $_POST['parser1'];
// Create DOM from URL or file
$html = file_get_html($html_str);
$html->load('
<form name="form1" action="parser.php" method="post">
<input type="text" name="parser1">
</form>');
// Get the form action
foreach($html->find('form') as $element)
echo $element->action . '<br>';
// Get the input name
foreach($html->find('input') as $element)
echo $element->name . '<br>';
?>
</body>
</html>
Here i am trying to enter the html source into the text box parser1
I am then catching the data from the textbox using post into a string html_str
when i try to parse that string, i start getting errors.
Fatal error: Call to a member function load() on a non-object in /home/public_html/parser.php on line 24
please help