";
if($_POST["resetval"] == 1)
{
//DELETE OLD FILE ON RESET
unlink($_POST["rmfile"]);
}
if (!$_POST["filename"])
{
echo "Please choose a (temporary) file name:";
echo "";
}
else if ($_POST["filename"] != "")
{
$filename = $_POST["filename"];
$filepath = "files/".$_POST["filename"];
$filecheck = file_exists($filepath);
if(($_POST["finish"] == 1) || ($_GET["returning"] == 1))
{
$filecheck = 0;
$fileopen = 1;
}
if ($filecheck == 1)
{
echo "File in use.. choose again:";
echo "";
}
else
{
if(!$_POST["finish"])
{
echo "Filename chosen: ";
echo $_POST["filename"];
echo "";
echo "";
}
if($fileopen != 1)
{
//CREATE & OPEN FILE & CHANGE PERMISSIONS TO 666
$handle = fopen($filepath, 'w');
chmod($filepath, 0666);
fclose($handle);
}
if ($_POST["finish"])
{
echo "Right Click to Save Target: ".$filename."";
echo "";
}
}
}
echo " | |