FutureQuest, Inc. FutureQuest, Inc. FutureQuest, Inc.

FutureQuest, Inc.
Go Back   FutureQuest Community > General Site Owner Support (All may read/respond) > PHP, Perl, Python and/or MySQL
User Name
Password  Lost PW

Reply
 
Thread Tools Search this Thread Display Modes
Old 05-07-1999, 03:47 PM   Postid: 42534
SneakyDave
Fond of TAZ
 
SneakyDave's Avatar

Forum Notability:
93 pts: Helpful Contributor
[Post Feedback]
 
Join Date: Feb 1999
Posts: 921
Extracting .htaccess user name in PHP

Is there a system variable that holds the .htaccess userid of a person accessing a protected directory?

Just checking! Thanks

Sneaky
SneakyDave is offline   Reply With Quote
Old 05-07-1999, 04:36 PM   Postid: 42535
Jacob Stetser
Visitor

Forum Notability:
0 pts:
[Post Feedback]
 
Join Date: Dec 1998
Location: Decatur, GA 30032
Posts: 447
yup, there is!


Code Sample:

$PHP_AUTH_USER





------------------
icongarden.com/?fq
icongarden: making good ideas grow.

Jacob Stetser is offline   Reply With Quote
Old 05-08-1999, 03:43 PM   Postid: 42536
SneakyDave
Fond of TAZ
 
SneakyDave's Avatar

Forum Notability:
93 pts: Helpful Contributor
[Post Feedback]
 
Join Date: Feb 1999
Posts: 921
Thanks Jacob, but it doesn't seem to work for me, I have a directory protected with .htaccess, and a form in that directory where I want to default the userid into. For example:

Code Sample:
<input type=text name=name size=30 value='<?php print $PHP_AUTH_USER; ?>'>



But the $PHP_AUTH_USER returns null. I looked up the documentation on it at www.php.net, and it seems that I'm using it right. Actually trying to print the authuser returns a null also.

Does anyone know what I'm doing wrong?

Thanks

Sneaky

[edit]Fixed spelling and clarified a few things[/edit]
[This message has been edited by SneakyDave (edited 05-08-99)]
SneakyDave is offline   Reply With Quote
Old 05-08-1999, 04:36 PM   Postid: 42537
SneakyDave
Fond of TAZ
 
SneakyDave's Avatar

Forum Notability:
93 pts: Helpful Contributor
[Post Feedback]
 
Join Date: Feb 1999
Posts: 921
R'ing TFM more and I found out that if I use $REMOTE_USER, it works fine. I assume if you used the &quot;other&quot; php authentication, then $PHP_AUTH_USER would work?

Sneaky
SneakyDave is offline   Reply With Quote
Old 05-08-1999, 07:48 PM   Postid: 42538
Justin
Visitor
 
Justin's Avatar

Forum Notability:
0 pts:
[Post Feedback]
 
Join Date: Jan 1999
Location: Kissimmee, FL
Posts: 3,672
That's funny - I was  going to suggest $REMOTE_USER when I first saw your quesion, but upon verification I couldn't get it to work... I'll try again later though. I can use that myself for my banner script, since  I now need a way for the sponsors to see their own stats   I might not use .htaccess though...

Oh, well, one more thing to know though   I know the environment variable REMOTE_USER is supposed to show that though, maybe I fubared something when I tried it (was real quick).

------------------
Justin Nelson
FutureQuest Support
Justin is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 visitors)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 12:55 AM.


Running on vBulletin®
Copyright © 2000 - 2013, Jelsoft Enterprises Ltd.
Hosted & Administrated by FutureQuest, Inc.
Images & content copyright © 1998-2013 FutureQuest, Inc.
FutureQuest, Inc.