Kevin,
I'm having some issues with my email client right now so I'm sorry if you've already found the answer. There is a way for PHP to do this without the need to modify your web server's configuration or bothering with .htaccess/ .htpasswd files by simply modifying the http headers that your pages produce. I'm not about to try to give you a working example as the fine folks at phpmyadmin have already done this in the form of an authentication library. If you have phpMyAdmin installed look in the "libraries/auth" directory for a file called "http.auth.lib.php". If not you can get it from www.phpmyadmin.net
Like I said, it is in library form so you can use it in your program as well (be sure to give credit per the GPL) but I haven't done so, so I'm not sure how much modification might be needed.
Cheers!
Bret Hughes wrote:
On Wed, 2005-02-16 at 21:31, Kevin Javia wrote:
I am experimenting on my site and I want to make it password protected like www.realsolution.com.
If any one enters correct user name and password, only then they will be able to enter into my site.
How can I do that in PHP?
Any ideas? Thanks a ton in advance.
Chances are this is not a php thing at all but uses the webserver's
authentication infrastructure. It depends on the server being used. The apache manual has a very good write up on authentication options
available:
See if this gets you started:
http://httpd.apache.org/docs-2.0/howto/auth.html
Bret