On Thu, 2006-03-30 at 11:22 +0100, Joseph Harris wrote:
> Is this denying access to my site?How on earth did it get
> there??# -FrontPage-
> DirectoryIndex index.shtml index.html index.htm index.php
> IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
Those are Front Page extensions, many hosts still install them by
default when they set up an account for you. It's okay to delete them if
you don't use FP, delete the UserFile and GroupFile too from where they
are located.
Your htaccess is probably created by and owned by the server itself
which is preventing you from overwriting it. You can delete it then
upload your own but you will need to delete it with a script run on the
server so it thinks the boss is talking and obeys.
Here's some php for a single file:
$return = @unlink('help/chapters/filename.txt');
// Return FALSE if not found
var_dump($return);
and for deleting an entire folder:
// rmdirr.inc.php
/*
25.07.2005
Author: Anton Makarenko
makarenkoa at ukrpost dot net
webmaster at eufimb dot edu dot ua
Original idea:
http://ua2.php.net/manual/en/function.rmdir.php
28-Apr-2005 07:35
development at lab-9 dot com
*/
function rmdirr($target,$verbose=false)
// removes a directory and everything within it
{
$exceptions=array('.','..');
if ([EMAIL PROTECTED]($target))
{
if ($verbose)
echo '<strong>Couldn’t open '.$target."</strong><br />\n";
return false;
}
while(false!==($sibling=readdir($sourcedir)))
{
if(!in_array($sibling,$exceptions))
{
$object=str_replace('//','/',$target.'/'.$sibling);
if($verbose)
echo 'Processing: <strong>'.$object."</strong><br />\n";
if(is_dir($object))
rmdirr($object);
if(is_file($object))
{
[EMAIL PROTECTED]($object);
if ($verbose&&$result)
echo "File has been removed<br />\n";
if ($verbose&&(!$result))
echo "<strong>Couldn’t remove file</strong>";
}
}
}
closedir($sourcedir);
if([EMAIL PROTECTED]($target))
{
if ($verbose)
echo "Target directory has been removed<br />\n";
return true;
}
if ($verbose)
echo "<strong>Couldn’t remove target directory</strong>";
return false;
}
rmdirr('/home/mgweb/public_html/help',true);
/*
// sample usage
<?php
require('./lib/rmdirr.inc.php');
rmdirr('D:/srv/Apache2/htdocs/testRm',true);
?>
//*/
I 'spose it should be mentioned that caution is the keyword here, you
could end up deleting everything if not careful :-)
--
cheers,
Mark
____ The WDVL Discussion List from WDVL.COM ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] or
use the web interface http://e-newsletters.internet.com/discussionlists.html/
Send Your Posts To: [email protected]
To change subscription settings, add a password or view the web interface:
http://intm-dl.sparklist.com/read/?forum=wdvltalk
________________ http://www.wdvl.com _______________________
You are currently subscribed to wdvltalk as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]
To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016
Please include the email address which you have been contacted with.