Author |
Message |
tgarcez
Junior WebHelper
Joined: 22 Apr 2003
Posts: 4
|
Posted:
Tue Apr 22, 2003 5:25 pm (21 years ago) |
|
Does anyone know how I can place HTML code into my web pages that would display:
logged in as : user
when logging in is based on .htaccess method.
?? please help ?? |
|
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Tue Apr 22, 2003 5:53 pm (21 years ago) |
|
This is possible, but not with HTML AFAIK.
Code: | logged in as user: <?php echo $_SERVER['REMOTE_USER']; ?> |
|
________________________________
|
|
|
|
tgarcez
Junior WebHelper
Joined: 22 Apr 2003
Posts: 4
|
Posted:
Tue Apr 22, 2003 6:23 pm (21 years ago) |
|
if the above doesn't do the trick...any other suggestions? |
|
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Tue Apr 22, 2003 6:33 pm (21 years ago) |
|
There's no reason why it shouldn't ... Unless you're using an older version of PHP, then use: Code: | logged in as user: <?php echo $REMOTE_USER; ?> |
Of course you'll have to name this file with a PHP enabled extension - usually .php. |
________________________________
|
|
|
|
tgarcez
Junior WebHelper
Joined: 22 Apr 2003
Posts: 4
|
Posted:
Tue Apr 22, 2003 7:42 pm (21 years ago) |
|
thanks - just needed to change to .php! thanks! you'll note i'm quite new to all of this! |
|
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Wed Apr 23, 2003 5:33 am (21 years ago) |
|
We all were once... |
________________________________
|
|
|
|
tgarcez
Junior WebHelper
Joined: 22 Apr 2003
Posts: 4
|
Posted:
Sat May 03, 2003 11:02 am (20 years, 12 months ago) |
|
Could you help again? What html code would log the user out (ie making a logout button) for htaccess? |
|
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Sat May 03, 2003 11:09 am (20 years, 12 months ago) |
|
I'm not really sure about that... Maybe this?
Code: | <a href="http://<?php echo $REMOTE_USER; ?>:dummypassword@www.domain.com/page.php">Logout</a> |
But that's really just a guess... |
________________________________
|
|
|
|
adam
Forum Moderator & Developer
Joined: 26 Jul 2002
Posts: 704
Location: UK
|
Posted:
Sat May 03, 2003 5:29 pm (20 years, 12 months ago) |
|
http authentication relies on the browser caching the username and password...so I don't think it's really possible (unless what daniel suggested works ) |
________________________________ It's turtles all the way down... |
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Sat May 03, 2003 5:31 pm (20 years, 12 months ago) |
|
My example basically relies on the possibilty of logging people in via the URL:
http://username:password@domain.com/directory/
So by providing a false password, a login box should appear prompting the user for the correct password... |
________________________________
|
|
|
|
adam
Forum Moderator & Developer
Joined: 26 Jul 2002
Posts: 704
Location: UK
|
Posted:
Sat May 03, 2003 5:33 pm (20 years, 12 months ago) |
|
yeah, that should work so long as the browser uses the login details in the url and clears its cache of the correct details - it will probably depend on the browser. |
________________________________ It's turtles all the way down... |
|
|
|
|
Page generation time: 0.146867 seconds :: 19 queries executed :: All Times are GMT
Powered by
phpBB 2.0
© 2001, 2002 phpBB Group :: Based on an FI Theme