htaccess
Author
Discussion

Robatr0n

Original Poster:

12,362 posts

246 months

Monday 10th April 2006
quotequote all
How familiar is everyone with htaccess?

I need to introduce a user log in for my PHP and MySQL database. Depending who logs in (i.e. Admin/Guest/Worker) different options will be available/restricted/non-existant.

I have a very small working knowledge of htaccess, does anyone have knowledge of this which they can share with me?

tinman0

18,231 posts

270 months

Monday 10th April 2006
quotequote all

.htaccess and .htpasswd said:

AuthName Login


AuthType Basic

PerlAuthenHandler Apache::AuthDBI::authen

PerlSetVar Auth_DBI_data_source dbi:mysql:mailbox
PerlSetVar Auth_DBI_username XXXXX
PerlSetVar Auth_DBI_password XXXXX
PerlSetVar Auth_DBI_pwd_table users
PerlSetVar Auth_DBI_uid_field XXXX_user
PerlSetVar Auth_DBI_pwd_field plain_password
PerlSetVar Auth_DBI_encrypted off
PerlSetVar Auth_DBI_pwd_whereclause admin='Y'

require valid-user


is that what you are looking for?

Robatr0n

Original Poster:

12,362 posts

246 months

Monday 10th April 2006
quotequote all
Possibly Yes!

As I have a very small working knowledge of it (have only ever set user name and password before) I just need to make sure that I can set access rights to different users. Would this allow me to do this?

JonRB

80,089 posts

302 months

Monday 10th April 2006
quotequote all
Perhaps some sort of PHP / MySQL reference book might be in order, plus a google search for an on-line tutorial on .htaccess?

JamieBeeston

9,294 posts

295 months

Monday 10th April 2006
quotequote all
Why the requirement for .htaccess
if you have PHP and MySQL already, why not simply make a PHP based login system which grants access rights based on the user credentials.

You could always shroud the whole thing in a HTaccess lockdown for extra security.

J

Robatr0n

Original Poster:

12,362 posts

246 months

Monday 10th April 2006
quotequote all
JamieBeeston said:
Why the requirement for .htaccess
if you have PHP and MySQL already, why not simply make a PHP based login system which grants access rights based on the user credentials.

You could always shroud the whole thing in a HTaccess lockdown for extra security.

J


I like this Idea. Unfortunatly im not quite sure as to how to achieve this though.

@Jon: Your definatly right! lol. Although I have 3 books here for PHP and MySQL, I still find it heard to attain the information required, they can be very vague and generic. As for online tutorials, PHP.net is a pretty good site.