Welcome to Dream.In.Code
Become a PHP Expert!

Join 150,180 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 2,137 people online right now. Registration is fast and FREE... Join Now!




PhpBB3 integrate I have code!

 
Reply to this topicStart new topic

PhpBB3 integrate I have code!

Ändrew
29 Aug, 2008 - 09:52 PM
Post #1

D.I.C Head
**

Joined: 21 Apr, 2008
Posts: 61


My Contributions
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
<?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
<?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.
error

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='.confused.gif**********/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
User is offlineProfile CardPM
+Quote Post

no2pencil
RE: PhpBB3 Integrate I Have Code!
29 Aug, 2008 - 09:58 PM
Post #2

My fridge be runnin OH NOEZ!
Group Icon

Joined: 10 May, 2007
Posts: 7,166



Thanked: 78 times
Dream Kudos: 2425
Expert In: Goofing Off

My Contributions
QUOTE(Ändrew @ 30 Aug, 2008 - 01:52 AM) *

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?
User is offlineProfile CardPM
+Quote Post

Ändrew
RE: PhpBB3 Integrate I Have Code!
29 Aug, 2008 - 11:42 PM
Post #3

D.I.C Head
**

Joined: 21 Apr, 2008
Posts: 61


My Contributions
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 biggrin.gif do you have any idea's?

Ändrew
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/9/09 03:48AM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month