<?php
//$xml = new DOMDocument();
//$xml->load('test.xml');
if(isset($_POST['add'])) {
$url = $_POST['url'];
$xml = simplexml_load_file("db/". $url . ".xml");
    $xml_song = $xml->addChild("song");     
    $xml_song->addChild("price", $_POST["price"]);
    $xml_song->addChild("artistname", $_POST["artistname"]);    
    $xml_song->addChild("tracknumber", $_POST["tracknumber"]);
    $xml_song->addChild("songname", $_POST['songname']);
    $xml_song->addChild("length", $_POST['length']);
    $xml->saveXML("db/". $url . ".xml");

echo ("Succes");
}
?>

<html>
<body>

<form  method="post" action="">
<input type="text" name="url" placeholder="Url">
<input type='text' name='artistname' placeholder='Artist'>
<input type='text' name='price' placeholder='Price'>    <br><br>



<input type='text' name='tracknumber' placeholder='Tracknumber'>
<input type='text' name='songname' placeholder='Name'>
<input type='text' name='length' placeholder='Length'>

<br>
<input type='submit' name='add'>    
</form>    
</body>
</html>