Link to home
Start Free TrialLog in
Avatar of lopband
lopband

asked on

Match (preg_match) user/pass to htpasswd file

Hey!

I have a  htpasswd file with a lot of user/password combos like this:

test:dGRkPurkuWmW2 (test:test)
test1:dGlAW3zdxeAG2 (test1:test1)
test2:dG/F7fZAgYRys (test2:test2)
test3:dGXpGzCltZZ72 (tes3t:test3)

I want to use a login form instead of BASIC_AUTH to authenticate my users...
so first we gotto get the values from the form (member_username,member_pass) then open my htpasswd:

$file = file_get_contents('/full/path/to/htpasswd');

Then I guess we have to preg_match the array and use array_flip/array_slice??

Thanks!
Avatar of lopband
lopband

ASKER

Highered points...
Avatar of lopband

ASKER

Highered points...
ASKER CERTIFIED SOLUTION
Avatar of p1tter_pattter
p1tter_pattter

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lopband

ASKER

Cool! Thanks!