Hi,
i need some help to create xml files from my upload form. For the form i used Soma's excellent example:
https://gist.github.com/somatonic/5233338
i modified it. I only have an email field and the upload. I don't erase the files in my tmp folder.
What i want is to create xml files with the same name. The same name that my files have.
Example:
photo1.png
photo2.png
photo1.xml
photo2.xml
....
i tried this code but i get stuck where i have to submit the entry from my email field.
// remove extension from filename
$withoutExt = preg_replace('/\\.[^.\\s]{3,4}$/', '', $files);
// create xml for switch
$doc = new DOMDocument('1.0');
$doc->formatOutput = true;
$root = $doc->createElement('phpemail');
$root = $doc->appendChild($root);
$email = $doc->createElement('email');
$email = $root->appendChild($email);
$text = $doc->createTextNode($form_fields);
$text = $email->appendChild($text);
$doc->save($upload_path . $withoutExt . ".xml");