PDA

View Full Version : Login code off the forums


mystic
10-26-2006, 10:15 PM
Well I am basicly trying to find a code that can do everything on the forums, like their control panel and stuff and shows there logged in and shows there avatar on the main site.

I am using phpbb2.

maximize
12-03-2006, 03:39 AM
Well, first you need to find out the cookie name that PHPBB2 sets after logging in.

Here is just a basic script I'll code for you:


<?php

//lets say the PHPBB2 Cookie name it sets is called user

$cookie = $_COOKIE['user'];

if(isset($cookie))
{
echo decrypt($cookie);
/* where decrypt function is the phpbb function to decrypt the cookie to get the users name */
}
else
{

$form = '<form action="login.php">
<input name="username" />
<input name="password" />
<input name="submit" type="submit" value="Login" />
</form>
';

/* replace the above with the correct form HTML */

echo $form;

}

?>