undefined constant DOMDocument

Hello,

When I run the following code, I get this warning:

Notice: Use of undefined constant DOMDocument - assumed ‘DOMDocument’ in C:\Dev_Area\www\FutManager\release\php\FMTester.php on line 31

Here is my code:(I’ve marked the line that is causing the warning.

[php] include “FutManager.php”;

// save XML
$target_path = basename( $_FILES[‘uploadedfile’][‘name’]);
move_uploaded_file($_FILES[‘uploadedfile’][‘tmp_name’], $target_path);

$gameXML = new DOMDocument();
$gameXML->validateOnParse = true;
$gameXML->preserveWhiteSpace = true;
$gameXML -> load(“teams.xml”);

// get team.xml data.
/* if (isset($_REQUEST[‘teamXML’]))// was sent from HTML.
{
$gameXML -> loadXML($_REQUEST[‘teamXML’]);
}
else
{

} */

// convert XML into FutManager useable data.

// build teams
$gameData = $gameXML->getElementById(‘teamData’);
$stadium = $gameXML->getElementById(‘stadium’);
$game = new Game($stadium->getAttribute(“name”),$stadium->getAttribute(“pitch_length”),$stadium->getAttribute(“pitch_width”), $stadium->getAttribute(“pitch_type”),buildTeamFromXML($gameXML->getElementById(“Home”)),buildTeamFromXML($gameXML->getElementById(“Visitor”)) ) ;

$FM = new FutManager($game); <<<------- The Line In Question ----------------
$finishedGameXML = $FM->playGame()->saveHTML();

// save game output
$myFile = “game.xml”;
$fh = fopen($myFile, ‘w’) or die(“can’t open file”);
fwrite($fh, “” . $finishedGameXML . “”);
fclose($fh);

// return HTML to load Flash.
$myFile = “indexTemplate.html”;
$fh = fopen($myFile, ‘r’);
$theData = fread($fh, filesize($myFile));
fclose($fh);

echo($theData);[/php]

take care,
lee

Sponsor our Newsletter | Privacy Policy | Terms of Service