Using htaccess username in php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
doubleohseven
Forum Newbie
Posts: 2
Joined: Sun Jan 02, 2005 12:31 am
Location: Pickering, Ontario, Canada

Using htaccess username in php

Post by doubleohseven »

Hi,

In the Simple News tutorial, it mentions there is a way to save the username from the htaccess protected files and use that as the author. Just wondering if anyone could show me how to do this, or direct me to a tutorial or post somewhere. Thanks!
AGISB
Forum Contributor
Posts: 422
Joined: Fri Jul 09, 2004 1:23 am

Post by AGISB »

There is no way to read the password of a .htaccess access window. The username however you can get using

Code: Select all

<?php
$_SERVER['REMOTE_USER']
?>
doubleohseven
Forum Newbie
Posts: 2
Joined: Sun Jan 02, 2005 12:31 am
Location: Pickering, Ontario, Canada

Post by doubleohseven »

ah yess... that's all I wanted... all I wanted was for my site to automatically enter the username into MySQL for the purpose of signing the news, instead of adding it in manually each time. Thanks a lot!
Post Reply