-
Hi:
I'm using password protected files/directories (.htaccess/.htpassword). If click on client login and then don't enter a password, there is a default "Autorization Required" page that appears. I've asked my host if I can customize this page, but they don't offer that ability. Moreover, it appears on my site within a frame, and doesn't look very good :)
See here:
http://www.ekigroup.com
(click on "client login")
Okay, so tech support indicated that I could intercept the cancelled request with Javascript, I guess for the purpose of supplying my own "Authorization Required" page. I've dabbled in Javascript a bit, but I have no idea how I might go about doing this. Does anyone have any idea???
James
He is risen!!!
-
Hi,
there is no way to "intercept" with javascript - once the server asks for the pass, you will see the auth dialog.
What you could do is show a html form of yours for logging in that requests the next page from
http://user:[email protected]/protected.html
This way the auth dialog only shows up if visitor types in wrong pass the first time
Better yet, use php or perl based system to control access
Musicman
-
"there is no way to "intercept" with javascript - once the server asks for the pass, you will see the auth dialog.
Hi Musicman:
Yeah, I found that out in another [javascript] forum I posted the same question in. I didn't really think it could be done. At least, I had no clue as to how it might be done, but I now realize that it is not possible.
Anyway, someone else suggested coding custom error pages using the following tut:
http://www.javascriptkit.com/howto/htaccess2.shtml
Unfortunately, I don't have permission to change the .htaccess files, or to change permissions for these files. I was able to rename them, then upload my own version, but they were just overwritten to the original, so I guess I'm stuck with the default pages--I kinda link the standard password prompt, so I'm not interested in cutomizing one.
As always, thanks for your expert advise.
James
He is risen!!!
-
Hi,
would you be able to rewrite the htpasswd file by a php or cgi script?
Musicman
-
Hi Musicman:
Ummm, I'd say, I don't know :)
My host does support CGI, PERL5, and PHP4, if that's what you mean, but I still don't know how I'd rewrite these pages. I tried creating my own protected directory, instead of through my control panel, uploading my own .htaccess/.htpassword files, but, again, they are being overwritten.
?
James
He is risen!!!