Topic: Login Problem from external site
Hello. I have been browsing the forums and I haven't quite found the solution to my problem. I have a login box on the main page of my site that logs a user into the forums. My problem is that after a user logs in, the page just refreshes and login box reappears. Is there a way I can have it say "Welcome Guest, Please login" if no one has logged in yet, and if a user is logged in it shows "Welcome [user]" and maybe under that have like a sub menu, like " Administration, Profile, Messages, Logout (if the user is an admin) or just "Profile, Messages, Logout" (if the user is not)
heres the current code im using
?php define('PUN_ROOT', 'boards/'); ?>
<?php
require PUN_ROOT.'include/common.php';
define('PUN_QUIET_VISIT', 1);
$redirect_url = 'boards/index.php' ;
if(isset($_SERVER['REQUEST_URI']))
$redirect_url = $_SERVER['REQUEST_URI'] ;
require PUN_ROOT.'lang/'.$pun_user['language'].'/login.php';
?>
<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: 0; margin-bottom: 0">
<input type="image" src="img/login.gif" name="login" value="<?php echo $lang_common['Login'] ?>" />
</form>