okay I have another login iissue.....
I have integrated my forums with my site....
http://www.xalaris.net/boards/index.php
When I try to login on the login box I created, I get a white page that says "Unable to Connect to Database!!" but if I go back, im logged in. The same thing happends when I try to log out...
I have put the following login script in my /includes/user folder and I have it included on my main.tpl using <pun_include "login.php">
<?php
define('PUN_ROOT', '../');
define('PUN_QUIET_VISIT', 1);
if (!$pun_user['is_guest']) {
echo '<p align="center" style="margin-top: 0; margin-bottom: 2"><font face="Verdana" style="font-size: 9pt" color="#FFFFFF">Hello '.pun_htmlspecialchars($pun_user['username']);
$avatardir = "img/avatars";
if ($img_size = @getimagesize($avatardir.'/'.$pun_user['id'].'.gif'))
$user_avatar = '<img src="'.$avatardir.'/'.$pun_user['id'].'.gif" alt="" border="0"/>
<body topmargin="0" leftmargin="0">
';
else if ($img_size = @getimagesize($avatardir.'/'.$pun_user['id'].'.jpg'))
$user_avatar = '<img src="'.$avatardir.'/'.$pun_user['id'].'.jpg" alt="" border="0"/>';
else if ($img_size = @getimagesize($avatardir.'/'.$pun_user['id'].'.png'))
$user_avatar = '<img src="'.$avatardir.'/'.$pun_user['id'].'.png" alt="" border="0" />';
else
$user_avatar = '<img src="'.$avatardir.'/no-avatar.jpg" alt="" border="0" />';
echo "<br><br>$user_avatar<br><br><b><font face='Verdana' style='font-size: 9pt' color='white'><a href='boards/login.php?action=out&id=".$pun_user['id']."&csrf_token=".sha1($pun_user['id'].sha1(get_remote_address()))."'>".$lang_common['Logout']."</a><br><br>" ; }
else
{
$redirect_url = '' ;
if(isset($_SERVER['REQUEST_URI']))
$redirect_url = $_SERVER['REQUEST_URI'] ;
require PUN_ROOT.'lang/'.$pun_user['language'].'/login.php';
echo '<center><p align="center" style="margin-top: -15; margin-bottom: 2"><font face="Verdana" style="font-size: 9pt" color="white"><br>Welcome Guest</font></center>';
?>
<form id="login" method="post" action="<?php echo PUN_ROOT.'login.php?action=in'; ?>">
<input type="hidden" name="form_sent" value="1" />
<input type="hidden" name="redirect_url" value="<?php echo $redirect_url ?>" />
<p align="center" style="margin-top: 2; margin-bottom: 2">
<b><font face="Verdana" style="font-size: 9pt" color="#FFFFFF">
Username:</font></b></p>
<p align="center" style="margin-top: 2; margin-bottom: 2">
<input type="text" name="req_username" size="13" style="font-family: Georgia; font-size: 8pt; font-weight: bold"></p>
<p align="center" style="margin-top: 2; margin-bottom: 2"><b>
<font face="Verdana" style="font-size: 9pt" color="#FFFFFF">
Password:</font></b></p>
<p align="center" style="margin-top: 2; margin-bottom: 2">
<input type="password" name="req_password" size="13" style="font-family: Georgia; font-size: 9pt; font-weight: bold"></p>
<p align="center" style="margin-top: -5; margin-bottom: -15">
<input type="image" src="imgs/login.gif" name="login" value="<?php echo $lang_common['Login'] ?>" width="80" height="34" /></form>
<?php
}
Can anyone tell me what im doing wrong?
**EDIT**
The "Unable to Connect to Database!!" message appears when I try posting, but if go back to the index, the post is there
thanks,
Juston