vorrei creare un file XML direttamente nella cartella del server con questo script (di prova)
Codice PHP:
$file= fopen("test.xml", "w");
$_xml ="<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\r\n";
$_xml .="<root>\r\n";
$_xml .="\t<news>\r\n";
$_xml .="\t\t<data>" . $gg."/".$mm."/".$aa . "</data>\r\n";
$_xml .="\t\t<testo_up>" . $news . "</testo_up>\r\n"; $_xml .="\t\t<img>" . $file . "</img>\r\n";
$_xml .="\t\t<testo_down>" . $news1 . "</testo_down>\r\n"; $_xml .="\t</news>\r\n"; $_xml .="</root>";
fwrite($file, $_xml);
fclose($file);
questi sono gli errori
Warning: fopen(test.xml) [function.fopen]: failed to open stream: Permission denied in D:\Inetpub\webs\thehardcrowscom\invia.php on line 46
Warning: fwrite(): supplied argument is not a valid stream resource in D:\Inetpub\webs\thehardcrowscom\invia.php on line 66
Warning: fclose(): supplied argument is not a valid stream resource in D:\Inetpub\webs\thehardcrowscom\invia.php on line 68
PLS help me ci sto sbattendo la capocchia da un bel po