![]() |
Creating a Login Script
Alright im trying to create a login script for the forum, dont ask me why but I need to create another one that logs the user in the forums, one thing got me stuck though, vbulletin encrypts the passwords and I cant figure out there encryption method.
All I need to do is compare the posted password (then encrypt it and i dont know how) to the password in the database, anyone care to show me how to encrypt it, NOTE: I cannot include any of the vbulletin files in my code. Heres what you have to work off of: <?php $username = $_POST['username']; $password = $_POST['password']; ?> I know the password is not just md5'ed i saw something like utf, never heard of it, and theres a salt stored in the database for each user, dont know what its for... please help its really important :D. |
Do a search on 'password salt' in the General Modification Discussion section and you will find many threads anwering this.
|
md5( md5( password ) . $salt ); is how the password is saved in the database
|
Alright thanks, I wrote up this code:
Code:
$query[select1] = mysql_query("SELECT userid, username, password, salt FROM user WHERE username='".$_POST[username]."' LIMIT 1"); |
why cant u include any vbulletin files?
|
Because im running this on a diffrent domain than the forums are on (but on the same server).
Im already connected to the database I just need to somehow get the posted password to encrypt correctly to match the one in the database >_> |
I read somewhere that md5 encrypts diffrently for diffrent domains, is this true? I thought it was just diffrently for each server... the domain thing isnt gonna be a problem for md5 is it?
Man im stupid, the query wasnt fetching because me being my forgetful self forgot to include config.php so I wasnt even connected to the database, and the script wasnt showing that there was an error, so didnt look like there was anything wrong, I fixed that, now it matches up to the one in the database, thanks again. |
All times are GMT. The time now is 06:25 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|