Sets the value of authuserfile property. AuthUserFile is the password file which contains username:password pairs for Basic authentication. You must give full path to the password file in order for it to work.
Parameter
string $file - absolute pathname to the password file.
<?php require_once('File_HtAccess.php'); /* set the password file to /etc/htpasswd */ $fh = new File_HtAccess('.htaccess'); $fh->load(); $fh->setAuthUserFile('/etc/htpasswd'); $fh->save(); /* set the password file to .htpasswd in current working directory */ $file = getcwd() . '/.htpasswd'; $fh = new File_HtAccess('.htaccess'); $fh->load(); $fh->setAuthUserFile($file); $fh->save(); ?>
Deliver First Class Web Sites: 101 Essential Checklists Want to learn how to make your web sites usable and accessible? Want to ensure that your sites meet current best practice, without spending hours trawling through incomprehensible specifications and recommendations from dozens of different books, research papers, and web sites? Want to make sure that the sites you build are "right the first time," requiring no costly redevelopments?