Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Retrieving .htaccess info
Name: Spinal Date: September 3, 2004 at 04:25:11 Pacific OS: irrelevant CPU/Ram: enough
Comment:
Hello! I'm having a little problem, on a section of my site, users have to log into a .htaccess password protected area. Ideally, once they log on, in the top right hand corner (for example) it says " Welcome Joe Blogs". The name should be retrieved from the info they entered in the .htaccess login part. Anyone know how to do this? I don't mind storing the name in a cookie on their computer, so maybe that will work. But I have no idea how to retrieve the username. Thanks, Spinal
Name: -Bryan- Date: September 3, 2004 at 09:21:13 Pacific
Reply:
Hi.
$_SERVER['REMOTE_USER'] will give you what you're looking for. However, remember that it will only display the username entered in the htaccess file, i.e. joeblogs or whatever the username might be.
To get the user's full name, something like "Joe Blogs" from that, you'll have to match the username to the person's actual name, presumably from a mySQL database. That's also easy to do and I'd be happy to go into that if you need me to.
Summary: My base question: can I write a cookie in one language and access it via another language? Specific situation: at work we have numerous webbased applications, written in PHP, Perl, and ColdFusion. La...
Summary: ive followed tutorials to configure the conf file, and have create the .htaccess & .htpasswd files i've actually posted something similar to this like a week ago. it wont let me log in. i put the name...
Summary: the ip address in ipconfig and http://www.cmyip.com/ are the same.... did wat u said..changed it STILL DOESNT WORK :( here is my httpd.conf file... and this is the name at free no-ip.com http://scifi...