hi, ive got a simplexml code to create xml files it worked before and now when i go to test it i get this error message "Fatal error: Call to undefined function: simplexml_load_string() in /home/theau10/public_html/resources/xmlcreator.php on line 17"
i've not changed any of my code but for some reason it comes with an error
-
<?
-
session_start();
-
if(!$_SESSION['myusername']){
-
header("location:index.php");
-
}
-
?>
-
<?php error_reporting(E_ALL);
-
-
$returnURL = $_POST['returnURL'];
-
$random_digit = $_POST['random_digit'];
-
$xmlFiles = array();
-
-
if(isset($_POST['create_xml'])){
-
-
// Create the object (with header)
-
$xmltext = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<images></images>";
-
$xmlobj = simplexml_load_string($xmltext);
-
-
-
foreach ($_POST['picT'] as $key => $value)
-
{
-
-
// Do something with your xml object
-
$child = $xmlobj->addChild("pics");
-
$child->addChild("image", $_POST['imageT'][$key]);
-
$child->addChild("thumbnail", $_POST['thumbnailT'][$key]);
-
$child->addChild("caption", $_POST['captionT'][$key]);
-
-
}
-
-
-
-
$path_dir = "upload/$random_digit/";
-
-
$path_dir .= "images.xml";
-
-
/* Data in Variables ready to be written to an XML file */
-
-
$fp = fopen($path_dir,'w');
-
-
$write = fwrite($fp,$xmlobj->asXML());
-
}
-
?>
-
-
<script language="JavaScript">
-
<!--
-
window.location="<? print $returnURL?>";
-
//-->
-
</SCRIPT>
-