4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 .htaccess
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
tgarcez
Junior WebHelper
Junior WebHelper


Joined: 22 Apr 2003
Posts: 4

PostPosted: Tue Apr 22, 2003 5:25 pm (14 years, 6 months ago) Reply with QuoteBack to Top

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 ??
OfflineView User's ProfileFind all posts by tgarcezSend Personal Message
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Tue Apr 22, 2003 5:53 pm (14 years, 6 months ago) Reply with QuoteBack to Top

This is possible, but not with HTML AFAIK.

Code:
logged in as user: <?php echo $_SERVER['REMOTE_USER']; ?>

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
tgarcez
Junior WebHelper
Junior WebHelper


Joined: 22 Apr 2003
Posts: 4

PostPosted: Tue Apr 22, 2003 6:23 pm (14 years, 6 months ago) Reply with QuoteBack to Top

if the above doesn't do the trick...any other suggestions?
OfflineView User's ProfileFind all posts by tgarcezSend Personal Message
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Tue Apr 22, 2003 6:33 pm (14 years, 6 months ago) Reply with QuoteBack to Top

There's no reason why it shouldn't Smile... 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.

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
tgarcez
Junior WebHelper
Junior WebHelper


Joined: 22 Apr 2003
Posts: 4

PostPosted: Tue Apr 22, 2003 7:42 pm (14 years, 6 months ago) Reply with QuoteBack to Top

thanks - just needed to change to .php! Very Happy thanks! you'll note i'm quite new to all of this!
OfflineView User's ProfileFind all posts by tgarcezSend Personal Message
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Wed Apr 23, 2003 5:33 am (14 years, 6 months ago) Reply with QuoteBack to Top

We all were once... Wink

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
tgarcez
Junior WebHelper
Junior WebHelper


Joined: 22 Apr 2003
Posts: 4

PostPosted: Sat May 03, 2003 11:02 am (14 years, 5 months ago) Reply with QuoteBack to Top

Could you help again? What html code would log the user out (ie making a logout button) for htaccess? Very Happy
OfflineView User's ProfileFind all posts by tgarcezSend Personal Message
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Sat May 03, 2003 11:09 am (14 years, 5 months ago) Reply with QuoteBack to Top

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...

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
adam
Forum Moderator & Developer



Joined: 26 Jul 2002
Posts: 704
Location: UK

PostPosted: Sat May 03, 2003 5:29 pm (14 years, 5 months ago) Reply with QuoteBack to Top

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 Smile)

________________________________
It's turtles all the way down...
OfflineView User's ProfileFind all posts by adamSend Personal MessageVisit Poster's Website
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Sat May 03, 2003 5:31 pm (14 years, 5 months ago) Reply with QuoteBack to Top

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... Question

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
adam
Forum Moderator & Developer



Joined: 26 Jul 2002
Posts: 704
Location: UK

PostPosted: Sat May 03, 2003 5:33 pm (14 years, 5 months ago) Reply with QuoteBack to Top

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...
OfflineView User's ProfileFind all posts by adamSend Personal MessageVisit Poster's Website
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.058978 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme