Jump to content


Photo

Logout button


  • Please log in to reply
6 replies to this topic

#1 Ciggy

Ciggy
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 19 October 2006 - 01:17 AM

<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>

<?php

require('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> &nbsp;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> &nbsp;<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'>";

}

 
?>

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!

#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 19 October 2006 - 01:23 AM

<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>

<?php

require('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> &nbsp;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> &nbsp;<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'>";

}

 
?>

logout.php

<?php
header("location:login.php");
?>

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#3 Ciggy

Ciggy
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 19 October 2006 - 01:50 AM

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.


#4 corbin

corbin
  • Staff Alumni
  • Advanced Member
  • 8,129 posts

Posted 19 October 2006 - 01:52 AM

<a href='logout.php'>Log Out</a>

then on logout.php
foreach($_SESSION as $k = $v)
{
$_SESSION[$k] = NULL;
}

Why doesn't anyone ever say hi, hey, or whad up world?

#5 Ciggy

Ciggy
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 19 October 2006 - 01:55 AM

<?php
foreach($_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


#6 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 19 October 2006 - 02:01 AM

dont do it like that like this ok

<?php session_start();

session_destroy();

session_unset();

header("location: login.php");
?>

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#7 Ciggy

Ciggy
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 19 October 2006 - 02:03 AM

Thank you very much both of you!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users