I made a flash object to put on my website that allows users to upload files with certain extensions ( in this case images ) and the files are uploaded to a php file named upload.php ( figures right? ) but now what I need is that when a user uploads a file for upload.php to not only move the file to the proper directory but to also add the name of that file to an xml file and at this point I am just guessing because I am terrible at php :-[
this is what I have so far (keep in mind I have pretty much no idea what I’m doing here):
[php]<?php
if (is_uploaded_file($_FILES[‘Filedata’][‘tmp_name’])) {
$uploadDirectory = "uploads/";
$uploadFile = $uploadDirectory . basename($_FILES['Filedata']['name']);
copy($_FILES['Filedata']['tmp_name'], $uploadFile);
$xml = simplexml_load_file('photodir.xml'); //Loads the xml file
$sxe = new SimpleXMLElement($xml->asXML()); //Creates SimpleXMLElemnt with source
$filename = basename($_FILES[‘name’]);
$imagename = $sxe->addChild(‘imagename’);
$imagename->addChild(“name”, $filename);
$sxe->asXML(‘photodir.xml’); //Saves the xml file
}
?>[/php]