I am trying to 2 merge 2 variable into one.
I have a file on my server that holds md5 encrypted passwords like this:
$pass01 = "md5md5md5md5"; // Off course there is a real hash there, just edited it for security.
$user01 = "John Doe";
$group01 = "admin";
What I'm trying to get done is to have PHP combine this info with a login form I made, it should check wheter $pass01 corresponds to that of "John Doe" but should do so outside the password file. I tried this:
if(md5($_POST['pass']) == $pass . $_POST['user'] . '') {
which should create $pass01, if user 01 logs in, $pass02 if user 02 logs in etc. Although it doesn't and I can't figure out why. What am I doing wrong here ?
Also it would be the best if users could login on the form using their name, rather then their number, right now all I use $user01 for is for greeting purposes, but would be great if it compared that name as being the username and see if the pass matches, but not sure how to do that, any hints on that are welcome too 🙂