$user = "bubu";
$file_ht = fopen("path_to_the_htaccess","r+");
if ($file_ht){
    $content_file = fread($file_ht, filesize("path_to_the_htaccess"));
    fclose($file_ht);
    $content_file = preg_replace("/".$user.".*\n/","",$content_file);
    $file_ht=fopen("path_to_the_htaccess","w+");
    if ($file_ht){
           fwrite($file_ht,$content_file);
           fclose($file_ht);
    }else{
        echo "Failed open for writing";
    }
}else{
     echo "failed open for reading";
}

You have to replace the user with the $user ( I don't know how do you take the user) 
and the path_to_the_htaccess

Hope it helps.

-- 
-------------------------------------------------
Cristian MARIN
InterAKT Online (www.interakt.ro)
+4021 411 2610 
[EMAIL PROTECTED]

  "Guru P Chaturvedi" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
  Hi Cristian,

  Well that's right... i wanna do it thru PHP Scrip... but dunno what exactly
  i should use... any clues...?


  "Cristian Marin" <[EMAIL PROTECTED]> wrote in message
  news:[EMAIL PROTECTED]
  Remove the line of the user from the .htpasswd. You can do it manually or a
  php script can do it for you.



  --
  -------------------------------------------------
  Cristian MARIN
  InterAKT Online (www.interakt.ro)
  +4021 411 2610
  [EMAIL PROTECTED]

    "Guru P Chaturvedi" <[EMAIL PROTECTED]> wrote in message
  news:[EMAIL PROTECTED]
    Hi,
    i am storing all users for accessing apache resources in a file called
    my.users i am able to add/modify users and passwords using the htpasswd
    utility. But not able to remove a particular user... are there anyways of
    doing it? can u please help...

    with Warm Regards,
    Guru.
    ---------------------------------------
    Phone: (+91)9845290270
    URL: www.gangarasa.com
    Yahoo IM: guru4vedi
    MSN: [EMAIL PROTECTED]
    ---------------------------------------





Reply via email to