PHP: Strange problem?

Ben

New member
Okay.. not sure what to say to this.. so here goes.

When I make a directory using PHP (on my home apache web server)

The folder is created, and exists but when I look in Windows Explorer, there is no folder there. And I can't type it in the address bar and goto it.

But on my php, it returns a true result when I test to see if it exists.. so.. what the F is going on?

code:
<?php
if(!isset($_POST['content']))
{
Header("Location: index.php");
}

if(!file_exists("preview")) { mkdir("preview"); }
$pd = "preview/".RandomString();
if(!file_exists($pd)) { mkdir($pd); }

$fw = fopen($pd."/content_data","w");
fwrite($fw, $_POST['content']);
fclose($fw);

if(file_exists($pd)) { echo "true"; } else { echo "false"; }

function RandomString()
{
$str = md5(rand());
return $str;
}
?>
 
Back
Top