ik heb een script voor laatste 5 topic's en een inlogscript voor phpbb 2 voor op de homepage kan inloggen ik kan maar een aan de gang krijgen en als ik de andere weg haal doet de andere het weet iemand hoe ik dat kan oplossen dit zijn de codes

login.php
<?php
define('IN_PHPBB', true);
// HET PAD NAAR JE FORUM (inclusief slash (/) aan het eind)
$phpbb_root_path = './forum/';
// PAGINA WAAR JE HEEN WIL NA HET INLOGGEN GEZIEN VANAF JE FORUM ROOT.
// Bijv: het pad naar je forum is ./forum/ je wilt na inloggen terug naar de hoofdmap van je site. $redirect wordt dan ../index.php
$redirect = '../index.php';

// NODIGE BESTANDEN INCLUDEN
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.' . $phpEx);

// GEGEVENS GEBRUIKER OPHALEN
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);

// IS DE GEBRUIKER INGELOGD?
if($userdata['user_id'] != '-1')
{
echo '<p>Je bent ingelogd als ' . $userdata['username'] . '<br />';
echo '<a href="' . $phpbb_root_path . 'login.php?logout=true&sid=' . $userdata['session_id'] . '&redirect=' . $redirect . '">Uitloggen</a></p>';
}
// GEBRUIKER IS NIET INGELOGD, FORMULIER WEERGEVEN
else
{
$url = $phpbb_root_path.'login.php';
?>
<style type="text/css">
<!--
.menu-tekst { background-color: #8E2438;
}
-->
</style>

<form action="<?php echo $url; ?>" method="post">
Gebruikersnaam <input type="text" name="username" value="Gebruikersnaam" onfocus="this.value='';" /><br />
Wachtwoord <input type="password" name="password" value="password" onfocus="this.value='';" /><br />
<input type="checkbox" checked="checked" name="autologin" /> Log automatisch in<br />
<input type="hidden" name="redirect" value="<?php echo $redirect; ?>" />
<input type="submit" name="login" value="Log in" />
</form>
<p><small>Nog geen lid? Klik <a href="<?php echo $phpbb_root_path . 'profile.php?mode=register'; ?>">hier</a> om te registreren.</small></p>
<?php
}
?>
<br />
<br />
Laatste topic's
<?php include_once ("Forum/config.php");
$mysql_connection = mysql_connect ($dbhost, $dbuser, $dbpasswd) or die ("Connection failed");
mysql_select_db ($dbname) or die ("Selecting database failed");

$query = "SELECT topic_id,topic_title FROM phpbb_topics order by topic_id desc limit 5
";
$res = mysql_query($query);
while($data = @mysql_fetch_array($res))
{
echo "&nbsp;<a href=\"Forum/viewtopic.php?t=".$data["topic_id"]."\">".$data['topic_title']."</a><br>";
}
?>
en bij de laatste topic's geef die aan Connection failed als ik ze samen doet

Reageren