-4

When I run my system in the localhost, it is successful. but when I put it into a server, it displays this error message..what is the problem?

Strict Standards</b>:  Non-static method DOMDocument::loadXML() should not be called statically, assuming $this from incompatible context in <b>F:\htdocs\bricksmind\hafiz\dochelper.php</b> on line <b>58

Below is the line 58 of dochelper.php:

$Xml = DOMDocument::loadXML($Data, LIBXML_NOENT | LIBXML_XINCLUDE | LIBXML_NOERROR | LIBXML_NOWARNING);
Nmir
  • 3
  • 3

1 Answers1

0

this error is caused because you are calling the method loadXML statically when it is not static.

You can fix this issue this way:

// create a DOMDocument instance
$doc = new DOMDocument();

// call the method on the instance
$doc->loadXML($Data, LIBXML_NOENT | LIBXML_XINCLUDE | LIBXML_NOERROR | LIBXML_NOWARNING);

// then print the XML 
echo $doc->saveXML();

hope this helps :-)

ponciste
  • 2,231
  • 14
  • 16