Page 1 of 1

crypt

Posted: Sun Jun 20, 2004 2:33 am
by ol4pr0
Have been looking around on the internet and found some, however i just cant get this to work..

the password has been send to the db like this

Code: Select all

$encrypted_password = crypt($_REQUEST['password']);
this i am trying to use to login... and many other ways.. however no luck

Code: Select all

#with form <input type=text name=username> and <input type=password name=password>
$encrypted_password ='SELECT password FROM users WHERE login=?',array($_REQUEST['username']));
if (crypt($_REQUEST['password'],$encrypted_password)==$encrypted_password);
{
	setcookie ("USERNAME", $_POST['username']);
	setcookie ("PASSWORD", $_POST['password']); 
	echo 'logged in';
} else {
	echo 'ERROR:';
}

Posted: Sun Jun 20, 2004 3:02 am
by infolock
well, look closely at this line :

Code: Select all

$encrypted_password ='SELECT password FROM users WHERE login=?',array($_REQUEST['username']));
what do you see wrong with it?

Posted: Sun Jun 20, 2004 3:06 am
by feyd
wouldn't he also need to actually execute the query to get the stored password before using said password?

Posted: Sun Jun 20, 2004 3:06 am
by infolock
that was kinda what i was hinting at ;)

Posted: Sun Jun 20, 2004 3:06 am
by markl999
We seem to have gone full circle back to here again :o

Posted: Sun Jun 20, 2004 3:08 am
by infolock
Locking thread. Old4pro, view your page in mark's link he just gave.

Posted: Sun Jun 20, 2004 3:08 am
by feyd
heh, I forgot about that thread.. :)