Jump to content

phpbb Session problems


Lessur

Recommended Posts

Ok, I am trying to hook the popular phpbb bullitin board system with a uploading system that I created.  I have merged the two databases together, so if someone signs up for phpbb (my forum) they also becsome a member of the uploading system.  Here are my files:

Ok, I have a simple script like this:

login.php:

[code]if ($_GET['submit']){
$username=addslashes(strip_tags($_POST['username']));
$password=addslashes(strip_tags($_POST['password']));
$password_md5=md5($password);
$check=mysql_num_rows(mysql_query("SELECT * FROM `phpbb_users` WHERE username = '$username' LIMIT 1"));
$check2=mysql_num_rows(mysql_query("SELECT * FROM `phpbb_users` WHERE `username` = '$username' AND `user_password` = '$password_md5' LIMIT 1"));

...


session_register('username');
$_SESSION['username'] = $username;
session_register('password');
$_SESSION['password'] = $password_md5;
echo "You are now logged in with the username $username! <a href='index.php'>Home</a>"; [/code]


On other file:


[code]<?php
if ($_SESSION['username']){
echo " [/code]

This, does not work, because phpbb is coding that is out of my knoledge. I will post phpbb's login.php file if it is needed.


For those more experianced people here that know how phpbb or a good forum runs, how can I make this work correctly?  ???
Link to comment
Share on other sites

[code]
<table cellpadding=5><tr valign=top class=mes><td align=center>
<fieldset>
<legend style="color: #ffffff; font-family: verdana; font-size: 10pt;"> <b>Forum Setup</b>&nbsp;</legend>
<table width="300" class=mes><tr><td align=center>

<?
if ($mode==''){

//// EDIT THIS LINE ////

$table_prefix = 'phpbb_'; // your phpBB table_prefix (check your phpBB config.php after installation)
////////////////////////

$phpBB_table = 'users';
$tmp=mysql_query("SELECT * FROM your database");
while($phpBB=mysql_fetch_array($tmp)) {
$phpBB_id = ($phpBB['id']);
$phpBB_n = ($phpBB['name']);
$phpBB_p = md5($phpBB['password']); // use md5 encryption
$phpBB_e = ($phpBB['email']);
$phpBB_reg = ($phpBB['regdate']);
$sql = "INSERT INTO ".$table_prefix.$phpBB_table." (user_id, username, user_level, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_viewemail, user_style, user_aim, user_yim, user_msnm, user_posts, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_pm, user_notify_pm, user_allow_viewonline, user_rank, user_avatar, user_lang, user_timezone, user_dateformat, user_actkey, user_newpasswd, user_notify, user_active) VALUES ( '$phpBB_id', '$phpBB_n', 0, '$phpBB_reg', '$phpBB_p', '$phpBB_e', '', '', '', '', '', '', 0, NULL, '', '', '', 0, 0, 1, 0, 1, 0, 1, 1, NULL, '', '', 0, '', '', '', 0, 1)";mysql_query($sql) or die(mysql_error());
}}
echo "Your members have been added to your phpBB users table.<br><br>";
echo "If you are logged in to the  script,<br><a href=phpBB_setup.php?mode=test_login class=menu>click here</a> to test the forum login.";
if ($mode!=''){
$tmp=mysql_query("SELECT * FROM xxxxx WHERE id= xxx LIMIT 1");
while($phpBB=mysql_fetch_array($tmp)) {
$phpBB_n = ($phpBB['name']);
$phpBB_p = ($phpBB['password']);

//// EDIT THIS LINE ////
echo "<form action=\"http://your_url/login.php\" method=\"post\" target=\"_blank\">";
////////////////////////

echo "<input type=\"hidden\" name=\"username\" size=\"25\" value=\"$phpBB_n\" maxlength=\"40\">";
echo "<input type=\"hidden\" name=\"password\" size=\"25\" value=\"$phpBB_p\" maxlength=\"32\">";
echo "<input type=\"submit\" name=\"login\" value=\"Test Login\">";
echo "</form>";}
}

?>
[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.