Connecting Tech Pros Worldwide Forums | Help | Site Map

.htaccess/PHP

Andy Jacobs
Guest
 
Posts: n/a
#1: Jul 17 '05
Hi all

Just wondering if this is possible:

I want to use htaccess to authenticate different users. What I would then
like to do is use the username from the htaccess box to set the session id
of the pages. Furthermore, I would like to use this to keep a check on
whether a user is logged in when they hit a page. This is so that I can
deliver content appropriate for each user. This is an existing project
where htaccess is being used. I'm just writing a backend for my customer so
that their clients can log fault calls.

Is this possible?

Andy


Marco Dieckhoff
Guest
 
Posts: n/a
#2: Jul 17 '05

re: .htaccess/PHP


On 2004-12-09, Andy Jacobs <andy@redcatmedia.net> wrote:[color=blue]
> Hi all
>
> Just wondering if this is possible:
>
> I want to use htaccess to authenticate different users. What I would then
> like to do is use the username from the htaccess box to set the session id
> of the pages. Furthermore, I would like to use this to keep a check on
> whether a user is logged in when they hit a page. This is so that I can
> deliver content appropriate for each user. This is an existing project
> where htaccess is being used. I'm just writing a backend for my customer so
> that their clients can log fault calls.
>
> Is this possible?[/color]

You are searching for $_SERVER["REMOTE_USER"]

--
Marco Dieckhoff
icq# 22243433
GPG Key 0x1A6C95BA -- http://www.frankonia-brunonia.de/keys
Justin Koivisto
Guest
 
Posts: n/a
#3: Jul 17 '05

re: .htaccess/PHP


Marco Dieckhoff wrote:
[color=blue]
> On 2004-12-09, Andy Jacobs <andy@redcatmedia.net> wrote:
>[color=green]
>>Hi all
>>
>>Just wondering if this is possible:
>>
>>I want to use htaccess to authenticate different users. What I would then
>>like to do is use the username from the htaccess box to set the session id
>>of the pages. Furthermore, I would like to use this to keep a check on
>>whether a user is logged in when they hit a page. This is so that I can
>>deliver content appropriate for each user. This is an existing project
>>where htaccess is being used. I'm just writing a backend for my customer so
>>that their clients can log fault calls.
>>
>>Is this possible?[/color]
>
>
> You are searching for $_SERVER["REMOTE_USER"][/color]

More info:

http://www.php.net/manual/en/features.http-auth.php

--
Justin Koivisto - spam@koivi.com
http://www.koivi.com
[-= Chris =-]
Guest
 
Posts: n/a
#4: Jul 17 '05

re: .htaccess/PHP


On Thu, 9 Dec 2004 11:40:44 +0000 (UTC), Andy Jacobs
<andy@redcatmedia.net> wrote:
[color=blue]
>Hi all
>
>Is this possible?
>[/color]

You can call the session ID pretty much whatever you like.

use something like:

session_id($userid);

on the page where the session is initiated.

C

Andy Jacobs
Guest
 
Posts: n/a
#5: Jul 17 '05

re: .htaccess/PHP


On 9/12/04 12:39 pm, in article 9ltl82-88h.ln1@hamlet.frbr.etc.tu-bs.de,
"Marco Dieckhoff" <dieck@gmx.de> wrote:
[color=blue]
> On 2004-12-09, Andy Jacobs <andy@redcatmedia.net> wrote:[color=green]
>> Hi all
>>
>> Just wondering if this is possible:
>>
>> I want to use htaccess to authenticate different users. What I would then
>> like to do is use the username from the htaccess box to set the session id
>> of the pages. Furthermore, I would like to use this to keep a check on
>> whether a user is logged in when they hit a page. This is so that I can
>> deliver content appropriate for each user. This is an existing project
>> where htaccess is being used. I'm just writing a backend for my customer so
>> that their clients can log fault calls.
>>
>> Is this possible?[/color]
>
> You are searching for $_SERVER["REMOTE_USER"][/color]

Bingo! Thanks for that.

A

Closed Thread