inherit
105681
0
Apr 30, 2013 13:48:46 GMT -8
Arjun
968
June 2007
adhanjal
|
Post by Arjun on Oct 23, 2009 20:43:05 GMT -8
Hola peoples: I have a question for ... someone . So here's the dealio: I have a directory protected by .htaccess and I was wondering if there was any way which I could, on the index (PHP) page, show, "Welcome, <username> (Full.Name)." somewhere on the page using PHP or JavaScript (or actually anything that would serve the function properly). Could someone please help me? Thanks
|
|
inherit
130228
0
Jul 11, 2024 19:19:59 GMT -8
Charles Stover
1,731
August 2008
gamechief
|
Post by Charles Stover on Oct 23, 2009 21:11:04 GMT -8
If the directory is protected by .htaccess, they won't be able to read the index.html file. Perhaps use mod_rewrite to redirect anybody that attempts to access /directory/ to directory-error.html
|
|
inherit
105681
0
Apr 30, 2013 13:48:46 GMT -8
Arjun
968
June 2007
adhanjal
|
Post by Arjun on Oct 24, 2009 4:41:52 GMT -8
I'm aware, but for people who are assigned a username and password to the protected directory, is it not possible to use the, "Welcome. You are authorized as <username> (FullName)?"
I want certain people to be able to access /directory/ using a username and password, but once they log in, I'd like it to show "Welcome. You are authorized as <username> (FullName)."
|
|
inherit
130228
0
Jul 11, 2024 19:19:59 GMT -8
Charles Stover
1,731
August 2008
gamechief
|
Post by Charles Stover on Oct 24, 2009 8:38:02 GMT -8
Okay, I see. For login-protected directories. I was thinking directories that couldn't be accessed at all. You could use the PHP variables $_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW'].
I'd strength-test it strenuously, to make sure people can't access it with invalid information, though. The only work I've done with such password-protected files wasn't exactly the "normal" use of them, so I had some strange side-effects, like people without valid login information loading the page. I'm not sure if that's just a feature of protected files or if it was a side effect of my screwing with the feature, so be sure to try all types of logins (valid, invalid with login, valid username with invalid password, cancelled login).
To debug, I mostly just did print_r($_SERVER) and read what was set for the user/pass each time, until I realized how it was functioning. But hopefully you won't have any of these problems. >_<
|
|
inherit
105681
0
Apr 30, 2013 13:48:46 GMT -8
Arjun
968
June 2007
adhanjal
|
Post by Arjun on Oct 24, 2009 16:43:14 GMT -8
Thanks . I'll try it out.
|
|