Would the following code which i put in the login page of the website get the user logged in into the forum? (can't try it out right now)
Would this be a method that works?
include "./punbb/include/functions.php"; //Make sure the following code has access to the pun_hash() and pun_setcookie() function definitions
$username = $user->Username; //Get the username of the logged in user and put it in a variable
$queryFromPunbb = "SELECT * FROM punbb_users WHERE username='$username'"; //get the id from the logged in user. This id is the primary key of the punbb_users table in the punbb database
$result = mysql_query($queryFromPunbb, $conn) or die (mysql_error()); //Run the query
$row = mysql_fetch_array($result) or die(mysql_error()); //Put the result of the query in an array called $row
$user_id = $row['id']; //Put the id from the $row array into the variable $user_id
$hashedPassword = pun_hash($user->Password); //hash the user's password using the punbb hash function
pun_setcookie($user_id, $hashedPassword, time()+24*60*60); //Set the punBB cookie, which is called punbb_cookie