pdarley
02-13-2008, 04:26 PM
I have no problem writing an xml file to the local directory my write_xml.php is in. But I am trying to hardcode a folder and having trouble. My code is below.
<?php
// Recieving the flash variables.
$xml = $_POST['xml'];
//$folder = "xml"
$folder = $_POST['folder'];
if(!is_dir($folder))
mkdir($folder, 0755);
$myFile = "http://www.mydomain.com/xml/audio.xml";
$fh = fopen($myFile, 'w') or die("can't open file");
fwrite($fh, $xml);
fclose($fh);
?>
Can anyone please advise how to write the xml file into a specific folder?
<?php
// Recieving the flash variables.
$xml = $_POST['xml'];
//$folder = "xml"
$folder = $_POST['folder'];
if(!is_dir($folder))
mkdir($folder, 0755);
$myFile = "http://www.mydomain.com/xml/audio.xml";
$fh = fopen($myFile, 'w') or die("can't open file");
fwrite($fh, $xml);
fclose($fh);
?>
Can anyone please advise how to write the xml file into a specific folder?