IT.COM

[Resolved] PHP help

Spaceship Spaceship
Watch
Impact
0
PHP help

i have a little problem with a script that i have..

$this->dom = new domDocument ;
@$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
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Last edited:
0
•••
so how should it look like?

sorry for these questions but i'm new in php programming and i'm learning :)

thanks
 
0
•••
there is an example on the php.net page

$this->dom = new domDocument ;

should be something like:-

$this->dom = new domDocument('1.0') ;

change 1.0 to the version of xml you are using.
 
0
•••
i put it like you said and i have the following error right now

Warning: domdocument() [function.domdocument]: Start tag expected, '<' not found in /home/..................php on line 107
 
0
•••
would need to see the proper code. Also the xml you are loading is it valid xml?
 
0
•••
0
•••
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back