Questo è l'intero codice del file in php:
Codice PHP:
<?php
//$name=$_POST['name'];
$name="111111";
$filename=$name.".xml";
$dir="./images/".$name;
$filealbum="./images/albums.xml";
$album=$dir."/".$filename;
$bool=false;
$boolo=false;
$answer="";
if(@dir($dir))
{
$boolo=false;
check($bool);
}
else
{
$boolo=true;
$bool=true;
mkdir($dir, 0777);
f_exists($filealbum);
//check($bool);
}
function f_exists($filealbum)
{
if(!file_exists($filealbum))
{
fopen("./images/albums.xml", "w+");
chmod("./images/albums.xml", 0775);
$bool=true;
}
else
{
$answer="file already exist";
}
xml_creator($album);
}
function xml_creator($album)
{
if(!file_exists($album))
{
$new_xml=fopen("$album","w");
$bool=true;
}
else
{
$bool=false;
$answer="The file $album exists";
}
check($bool);
}
function check($bool)
{
if($bool&&$boolo)
{
$answer="ok";
echo ("answer=".$answer);
}
else
{
$answer="no";
echo ("answer=".$answer);
}
}
?>