...

View Full Version : check if folder exists



bucket
10-28-2009, 02:35 PM
I have this script


<?php
$dirname = $_POST["install"];
$filename = "{$dirname}/";
if (file_exists($filename)) {
?>

PLEASE DELETE THE INSTALL DIRECTORY!

<?php
}
else
{
?>
OTHER MESSAGE IF THERE IS NO INSTALL DIRECTORY
<?php
}
?>

It seems to not work, When I do have the install folder it says:
PLEASE DELETE THE INSTALL DIRECTORY!

and when I delete it, the message stays the same, does anyone know the problem?

bucket
10-28-2009, 02:41 PM
Sorry guys, I fixed it.


<?php
$filename = "install/";
if (file_exists($filename)) {

echo "PLEASE DELETE THE INSTALL DIRECTORY!";

}
else
{
?>
OTHER MESSAGE IF THERE IS NO INSTALL DIRECTORY
<?php
}
?>

I removed the $_POST thing and just hardcoded it.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum