I know thins is not secure at all, but it is still before the beta stage and I'm just looking for functionality. So, I have a user input area where they put in their information. From there, the information is sent to a PHP file which makes it an XML file from there. The only problem is, there are no tags so I will show you the code used to create the XML file and the XML file too.
HTML
<form action="insertdata.php" method="post">
Data1<input name="data" value="" type="text" placeholder="Data">
Data2 <input name="data2" value="" type="text" placeholder="Data">
<input type="submit" value="Submit">
</form>
PHP
$xml = new DOMDocument("1.0");
$data = $xml ->createElement ("Data");
$datat = $xml -> createTextNode($_POST['data']);
$data = $xml ->appendChild ($datat);
$data1 = $xml -> createElement ("Data1");
$data1t = $xml -> createTextNode ($_POST['data1']);
$data1 = $xml -> appendChild ($data1t);
//echo "<xmp>".$xml -> saveXML (). "</xmp>";
$xml ->save("'".$_POST[data]."'.xml") or die ("error creating file");
So, my problem is not the creation of the XML file, it's that the XML file looks like this:
<?xml version="1.0"?>
Datainput
datainput1
Why isn't the data within the file contained by tags? Also, how would you be able to do this?