Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: .htaccess and MySQL

  1. #11
    Join Date
    Aug 2011
    Posts
    32
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    Quote Originally Posted by JShor View Post
    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.
    What does "Dont sue me" mean? This isn't legal stuff lol.

  2. #12
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    557
    Thanks
    8
    Thanked 66 Times in 66 Posts

    Default

    Did you get it working?
    - Josh

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •