Hi. I've been looking around but can't seem to find an easy answer. All I want to do is be able to is authenticate a user and password against the vbulletin user (4.1.4) database on a domain that is separate from the forums (hence not shared cookies) and go from there.
Don't need anything fancy. I just want to be able to have them authenticate that they are a forum user on the forum domain.
I'm sorry if I missed an article, but could someone point something like this out or demonstrate how it might be done?
Thanks in advance.
--------------- Added [DATE]1310747479[/DATE] at [TIME]1310747479[/TIME] ---------------
I found this, but it does not work.
Code:
<form action="index.php?p=login" method="post" enctype="multipart/form-data">
Username: <input type="text" name="user" />
Password: <input type="password" name="pass" />
<input type="submit" value="Login" />
</form>
<?php
if ( $_GET['p'] == 'login' ) {
$host = "localhost";
$user = "username";
$pass = "password";
$$db = "forums";
$con = mysql_connect($server, $username, $password);
mysql_select_db($database);
// MD5 the form password
$md5Pass = MD5(MD5(pass.salt));
// Get user details from MySQL Table
print "$md5Pass<br>";
$Query = mysql_query( " SELECT * FROM user WHERE username = '$_POST[user]' " );
$result = mysql_fetch_array( $Query );
// Check that the form password matches the one in the database
if ( $md5Pass == $result['password'] ) {
echo 'User logged in';
} else {
echo 'Wrong Password, please try again';
}
}
?>
Can anyone be of assistance?