i have a little problem with a script that i have.. $this->dom = new domDocument ; <---this is line 107 @$this->dom->loadHTML($this->data); foreach ($this->dom->getElementsByTagName('body') as $node) { $this->parseNode($node, $exclude); $object = $this->dom->createElement('div'); ob_start(); include 'php/includes/urlForm.inc.php'; $content = ob_get_clean(); $object->nodeValue = '{URL_FORM}'; $references = $node->getElementsByTagName('*'); $i = 0; foreach ($references as $reference) { if (!$i) { $node->insertBefore($object, $reference); } $i++; } } I have this code... when i try to execute it i get this line: Warning: domdocument() expects at least 1 parameter, 0 given in /home/...........php on line 107 can anyone help me? thanks
can you post your domDocument class? It's looking for a parameter, like: $this->dom = new domDocument($something);
On line 107, you are creating a new instance of the object, but $this is used within the object, so you can't use $this. Try $blah = new domDocument ; then edit your code accordingly.