You would open the file remotely, ensuring that only your server has read/write permission on the file. Then you would write to it, and close the file.
Something like this:
PHP Code:
$ip = "192.168.0.1";
$dir = "/home/directory/.htaccess";
$htaccess = fopen($dir);
$contents = file_get_contents($dir);
fwrite($htaccess, $contents."\nDENY FROM $ip");
fclose($htaccess);
This is purely sample code for demonstration only. Please don't sue me.
Bookmarks