Ciggy Posted October 19, 2006 Share Posted October 19, 2006 [code]<STYLE type="text/css"><!--BODY {background-color: FFC55E;scrollbar-face-color: FFC55E;scrollbar-highlight-color: FFC55E;scrollbar-3dlight-color: FFC55E;scrollbar-darkshadow-color: F2B03B;scrollbar-shadow-color: FFC55E;scrollbar-arrow-color: 000000;scrollbar-track-color: FFC55E;}--></STYLE><?phprequire('config.php');if($userData[user] =="" || $userData[pass] ==""){ Echo"Username: Not Logged In - Click <a href='login.php'>here</a> to login. <hr width='100%' height='1' color='#000000' shade='no'>";}else{if ($userData[rank] =="NR"){ $linksVar ="<br> Please visit <a href='/news' target='_blank'>here</a> and login with the same username and password to add/edit/manage the news.";echo $linksVar;exit;}else if($userData[rank] =="0"){ $linksVar ="You are no longer staff at $websiteName, Sorry."; }else{ $linksVar ="<br> <a href='requests.php'>Request Line</a> | <a href='info.php'>Radio Info</a> | <a href='rules.php'>DJ Rules</a> | <a href='cps.php'>Control Panels</a> | <a href='message.php'>DJ Says</a> ";} Echo"User: <b>$userData[user]</b> Rank: <b>$userData[rank]</b>$linksVar <hr width='100%' height='1' color='#000000' shade='no'>";} ?>[/code]I would like a log out button rite next under the DJ says which i want align to the right. I want after you log out for it just to go to the page login.php hope you can help. Thanks so much! Link to comment https://forums.phpfreaks.com/topic/24395-logout-button/ Share on other sites More sharing options...
redarrow Posted October 19, 2006 Share Posted October 19, 2006 [code]<STYLE type="text/css"><!--BODY {background-color: FFC55E;scrollbar-face-color: FFC55E;scrollbar-highlight-color: FFC55E;scrollbar-3dlight-color: FFC55E;scrollbar-darkshadow-color: F2B03B;scrollbar-shadow-color: FFC55E;scrollbar-arrow-color: 000000;scrollbar-track-color: FFC55E;}--></STYLE><?phprequire('config.php');if($userData[user] =="" || $userData[pass] ==""){ Echo"Username: Not Logged In - Click <a href='login.php'>here</a> to login. <hr width='100%' height='1' color='#000000' shade='no'>";}else{if ($userData[rank] =="NR"){ $linksVar ="<br> Please visit <a href='/news' target='_blank'>here</a> and login with the same username and password to add/edit/manage the news.";echo $linksVar;exit;}else if($userData[rank] =="0"){ $linksVar ="You are no longer staff at $websiteName, Sorry."; }else{ $linksVar ="<br> <a href='requests.php'>Request Line</a> | <a href='info.php'>Radio Info</a> | <a href='rules.php'>DJ Rules</a> | <a href='cps.php'>Control Panels</a> | <a href='message.php'>DJ Says</a> "; <a href='logout.php'>Log Out</a> ";} Echo"User: <b>$userData[user]</b> Rank: <b>$userData[rank]</b>$linksVar <hr width='100%' height='1' color='#000000' shade='no'>";} ?>[/code]logout.php[code]<?phpheader("location:login.php");?>[/code] Link to comment https://forums.phpfreaks.com/topic/24395-logout-button/#findComment-110988 Share on other sites More sharing options...
Ciggy Posted October 19, 2006 Author Share Posted October 19, 2006 Does not log out just brings to the login page which displays you are already logged in. I need an end session somewhere or something. Link to comment https://forums.phpfreaks.com/topic/24395-logout-button/#findComment-110996 Share on other sites More sharing options...
corbin Posted October 19, 2006 Share Posted October 19, 2006 [code=php:0]<a href='logout.php'>Log Out</a>[/code]then on logout.php[code=php:0]foreach($_SESSION as $k = $v){$_SESSION[$k] = NULL;}[/code] Link to comment https://forums.phpfreaks.com/topic/24395-logout-button/#findComment-110999 Share on other sites More sharing options...
Ciggy Posted October 19, 2006 Author Share Posted October 19, 2006 <?phpforeach($_SESSION as $k = $v){$_SESSION[$k] = NULL;}header("location:login.php");?>Parse error: syntax error, unexpected '=', expecting ')' in /home/lobby/public_html/lyt07v1/logout.php on line 2 Link to comment https://forums.phpfreaks.com/topic/24395-logout-button/#findComment-111002 Share on other sites More sharing options...
redarrow Posted October 19, 2006 Share Posted October 19, 2006 dont do it like that like this ok[code]<?php session_start();session_destroy();session_unset();header("location: login.php");?>[/code] Link to comment https://forums.phpfreaks.com/topic/24395-logout-button/#findComment-111004 Share on other sites More sharing options...
Ciggy Posted October 19, 2006 Author Share Posted October 19, 2006 Thank you very much both of you! Link to comment https://forums.phpfreaks.com/topic/24395-logout-button/#findComment-111005 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.