H. Could someone please tell me why the following code give me an error (at the bottom of this post);
open(HTACCESS, ">$root/.htaccess") || die &error("Unable to create .htaccess file. Reason : $!");
print HTACCESS "AuthName \"MEMBER ONLY\" \n";
print HTACCESS "AuthType Basic \n";
print HTACCESS "AuthUserFile $root/.htpasswd \n";
print HTACCESS "$print_cobalt \n";
print HTACCESS "require valid-user \n";
close(HTACCESS) || die &error("Unable to close the .htaccess file. Reason: $!");
open(HTPASSWD, ">$root/.htpasswd") || die &error("Unable to create .htpasswd file. Reason : $!");
print HTPASSWD "$admin_username:$crypted_admin_password\n";
close(HTPASSWD) || die &error("Unable to close the .htpasswd file. Reason: $!");
AuthName takes one argument, The authentication realm (e.g. "Members Only")
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Code:
if ($cobalt ne "") { $print_cobalt = "AuthPAM_enabled off"; } else { $print_cobalt = ""; } open(HTACCESS, ">$root/.htaccess") || die &error("Unable to create .htaccess file. Reason : $!");
print HTACCESS "AuthName \"MEMBER ONLY\" \n";
print HTACCESS "AuthType Basic \n";
print HTACCESS "AuthUserFile $root/.htpasswd \n";
print HTACCESS "$print_cobalt \n";
print HTACCESS "require valid-user \n";
close(HTACCESS) || die &error("Unable to close the .htaccess file. Reason: $!");
open(HTPASSWD, ">$root/.htpasswd") || die &error("Unable to create .htpasswd file. Reason : $!");
print HTPASSWD "$admin_username:$crypted_admin_password\n";
close(HTPASSWD) || die &error("Unable to close the .htpasswd file. Reason: $!");
AuthName takes one argument, The authentication realm (e.g. "Members Only")
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!