hey guys, not sure how i should name the title of the post.
i'm having a submitbutton on my page that's creating a folder for me. as soon as i press it. the site AUTOMATICALLY refreshes. There's no script set in my document that says the page should refresh. it just happens when i submit anything, right?
if (isset($_POST['createDir'])) {
$dir = $_POST['dirname'];
$targetfilename = PATH . '/' . $dir;
if (!is_dir($targetfilename)) {
mkdir($targetfilename);
chmod($targetfilename, 0777);
} else {
echo "Folder exists!";
}
}
a bit further down in my script i have the same thing to delete files and folders.
if (isset($_POST['deleteBtn'])) {
chmod(PATH, 0777);
foreach ($_POST['deletefiles'] as $value) {
unlink(PATH . '/' . $value);
}
echo "<META HTTP-EQUIV=Refresh CONTENT='0'>"; //doesn't work without it!
}
if i click the submitbutton to delete a folder the pages DON'T refresh. Even though the script works and the files get deleted. Where is difference between the script creating a folder and the other one to delete files. I actually don't really get it.
regards matt