i've created my code to go from a form to xml, it creates the xml and saves it on my server perfectly fine....the problem im having now is the loop is only picking up the last form entry instead of all form entries.
This is my code
This is my code
Code:
<?php
if(isset($_POST['create_xml'])){
$picT = $_POST['picT'];
$photoT = $_POST['photoT'];
$captionT = $_POST['captionT'];
$xmltext = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<gallery></gallery>";
$xmlobj = simplexml_load_string($xmltext);
$nameCapsA = $xmlobj->addChild("$picT");
$nameCapsA->addAttribute("name", "$photoT");
$nameCapsA->addAttribute("caption", "$captionT");
// set output filename
$filename= "test1.xml";
print header("Content-type: text/plain") . $xmlobj->asXML();
}
?>
Comment