View previous topic :: View next topic |
Author |
Message |
Kristof n00b
Joined: 14 Jul 2004 Posts: 61 Location: Belgium
|
Posted: Sat Aug 07, 2004 3:31 pm Post subject: [solved] $REMOTE_USER not set with Apache2.0.50 and PHP4.3.8 |
|
|
Hello,
I just installed Apache 2 and php_mod on my computer. But I still have a little problem I can't get fixed.
I have some php scripts that can only be executed when the user is logged in with .htaccess, so the scripts begin like this:
Code: | if ($REMOTE_USER == "")
exit;
/*The rest of the php script comes here*/ |
And these scripts work when I use them on my webspace I get from my school. But when I try to run them on my own webserver, the $REMOTE_USER variable doesn't have a value.
And the directory the script is in is protected with a .htaccess file and I'm pretty sure its correct (because I have to login before I can get to that directory).
The .htaccess file is as follows:
Code: | AuthUserFile /home/kristof/public_html/filemanager/.htpasswd
AuthGroupFile /dev/null
AuthName "Filemanager"
AuthType Basic
require valid-user |
Anyone know how I can solve this problem? Might there be something wrong with my php or apache configuration?
Greetings,
Kristof
Last edited by Kristof on Sun Aug 08, 2004 8:38 am; edited 1 time in total |
|
Back to top |
|
|
sf_alpha Tux's lil' helper
Joined: 19 Sep 2002 Posts: 136 Location: Bangkok, TH
|
Posted: Sat Aug 07, 2004 5:08 pm Post subject: |
|
|
using $REMOTE_USER Is deprecated ...
You need to use server environment associative array
$_SERVER["REMOTE_USER"] or something like these (I don't sure)
Or you can use deprecated and security risk 'register_globals' to set variable for environment and form data.[/url] _________________ Gentoo Mirrors in Thailand (and AP)
http://gentoo.in.th |
|
Back to top |
|
|
sf_alpha Tux's lil' helper
Joined: 19 Sep 2002 Posts: 136 Location: Bangkok, TH
|
Posted: Sat Aug 07, 2004 5:09 pm Post subject: |
|
|
using $REMOTE_USER Is deprecated ...
You need to use server environment associative array
$_SERVER["REMOTE_USER"] or something like these (I don't sure)
Or you can use deprecated and security risk 'register_globals' to set variable for environment and form data. _________________ Gentoo Mirrors in Thailand (and AP)
http://gentoo.in.th |
|
Back to top |
|
|
Kristof n00b
Joined: 14 Jul 2004 Posts: 61 Location: Belgium
|
Posted: Sun Aug 08, 2004 8:38 am Post subject: |
|
|
Thanks alot, this fixed my problem...
Greetings,
Kristof |
|
Back to top |
|
|
|