2 Replies - 1658 Views - Last Post: 30 August 2008 - 12:42 AM Rate Topic: -----

#1 Ändrew  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 25
  • View blog
  • Posts: 312
  • Joined: 21-April 08

PhpBB3 integrate I have code!

Posted 29 August 2008 - 10:52 PM

Hi,

I really need help. I'm trying to integrate PHPBB3 login with my site.Now I have taken tutorials and stuff and made my own using them.

upc.php
<?php
define('IN_PHPBB', true);
$phpbb_root_path = '/forum/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();

if (!$user->data['is_registered'])
{
?>
<form method="POST" action="/forum/ucp.php?mode=login" >
<p>Username: <input type="text" name="username" size="20"><br />
Password: <input type="password" name="password" size="20"><br />
Remember Me?: <input type="checkbox" name="autologin"><br />
<input type="submit" value="Submit" name="login"></p>
<input type="hidden" name="redirect" value="/ucploggedin.php">
</form>
<?php
}
else
{
echo 'Hello &nbsp;', $user->data['username'],' &nbsp; You are logged in!';
}
?>


ucploggedin.php
<?php
    define('IN_PHPBB', true);
    $phpbb_root_path = '/forum/';
    $phpEx = substr(strrchr(__FILE__, '.'), 1);
    include($phpbb_root_path . 'common.' . $phpEx);
     
    // Start session management
    $user->session_begin();
    $auth->acl($user->data);
    $user->setup();

    if($user->data['is_registered'])
    {
	//Already Loged in
	echo "<b>Hello, $user->data['username']<b><br><br>"
	echo "<li><a href="$phpbb_root_path . 'ucp.php?i=pm&folder=inbox'">Messages</a><br>"
	echo "<li><a href="$phpbb_root_path . 'ucp.php'">Profile</a><br>"
	echo "<li><a href="/forum/">Forum</a><br><br><br>"
	echo "<center><b><a href="$phpbb_root_path . 'ucp.php?mode=logout&sid=' . $user->data['sid']">Logout</a><b>"
    }
    else
    {
     header('Location: /ucp.php');
    }
?>


Now the error I'm getting is this.
Warning: include(/forum/common.php) [function.include]: failed to open stream: No such file or directory in /home/donclurd/public_html/testchamber/ucp.php on line 5

Warning: include() [function.include]: Failed opening '/forums/common.php' for inclusion (include_path='.://>**********/php2/pear/PEAR') in /home/donclurd/public_html/testchamber/ucp.php on line 5

Fatal error: Call to a member function session_begin() on a non-object in /home/donclurd/public_html/testchamber/ucp.php on line 8


And I don't know what it is... says it cant be included. And that file is there!

Ändrew

Is This A Good Question/Topic? 0
  • +

Replies To: PhpBB3 integrate I have code!

#2 no2pencil  Icon User is online

  • Toubabo Koomi
  • member icon

Reputation: 5247
  • View blog
  • Posts: 27,069
  • Joined: 10-May 07

Re: PhpBB3 integrate I have code!

Posted 29 August 2008 - 10:58 PM

View PostÄndrew, on 30 Aug, 2008 - 01:52 AM, said:

And I don't know what it is... says it cant be included. And that file is there!

Does the web server have permissions to open that file?
Was This Post Helpful? 0
  • +
  • -

#3 Ändrew  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 25
  • View blog
  • Posts: 312
  • Joined: 21-April 08

Re: PhpBB3 integrate I have code!

Posted 30 August 2008 - 12:42 AM

Yes because a removed the forbidden to it so I could access it. I thought ahead!
And that's one of the reasons I posted because iv tryed it :D do you have any idea's?

Ändrew
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1