Forum Moderators: open

Message Too Old, No Replies

Passwording phpmyadmin and php scripts

This is an urgent issue

         

dougmcc1

12:06 am on Feb 24, 2007 (gmt 0)

10+ Year Member



I'm using XAMPP on my Windows machine to run a website that is accessible to my co-workers when they type in my ip address into their browser.

How can I prompt for a password when they go to [#*$!.xx.xx.#*$!...] I set a password to the root user, and modified config.inc.php to include the password:
$cfg['Servers'][$i]['password'] = '(the password)';

But when anyone goes to [#*$!.xx.xx.#*$!...] they aren't even prompted for the password I just applied.

Also, my php scripts no longer connect to the database even though I added the password to mysql_connect():
$dbh=mysql_connect ("localhost", "root","(the password)") or die ('System is down. We apologize for the inconvenience. Please try again soon.' . mysql_error());

So all of my scripts now say:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: NO) in C:\site\xampp\htdocs\xampp\login.php on line 12
System is down. We apologize for the inconvenience. Please try again soon.

This is really urgent. Any help would be greatly appreciated.

Thanks.

dougmcc1

1:49 am on Feb 26, 2007 (gmt 0)

10+ Year Member



I fixed the issue with my scripts, but I'm still having trouble figuring out to password protect phpmyadmin. When anyone accesses phpmyadmin it logs them in as root@localhost automatically. How do I prevent this?

dougmcc1

2:15 am on Feb 26, 2007 (gmt 0)

10+ Year Member



I copied some files from the "restricted" folder and pasted them into the phpmyadmin folder and that seemed to work. The files were .htaccess and .htpasswd. How can I add my own usernames to it?