Jump to content

Recommended Posts

Can anyone tell me why this script I made isn't working? It's supposed to check whether or not someone is logged in, and show a different set of menu buttons for both situations, but all that's happening is that it's showing the set for when it's logged in no matter what. ><

 

<html>
<head>
</head>
<body bgcolor="black">
<?php
if($_SESSION['logged_in']=true)
{
?>
<font size="5" color="white" face="Lucida Handwriting,Arial">
</font>
<br />
<form>
<table width="100%" border="0" cellspacing="3" cellpadding="0">
<tr>
<td width="100%"><font face="Verdana" color="white" size="4"><body vlink="white" alink="white" link="white" />
<center><a href="index.php">Home</a></center><br /></font></td>
</tr>
<td width="100%"><font face="Verdana" color="white" size="4"><body vlink="white" alink="white" link="white" />
<center><a href="coming.php">Forums</a><br /></center><br /></font></td>
</tr>
<tr>
<td width="100%"><font face="Verdana" color="white" size="4"><body vlink="white" alink="white" link="white" />
<center><a href="base.php">Base</a><br /></center><br /></font></td>
</tr>
<tr>
<td width="100%"><font face="Verdana" color="white" size="4"><body vlink="white" alink="white" link="white" />
<center><a href="coming.php">Etc.</a><br /></center><br /></font></td>
</tr>
<tr>
<td width="100%"><font face="Verdana" color="white" size="4"><body vlink="white" alink="white" link="white" />
<center><a href="logout.php">Logout</a><br /></center><br /></font></td>
</tr>
<tr>
</table>
</form>
<?php
} elseif($_SESSION['logged_in']=false) {
?>
<br />
<form>
<table width="100%" border="0" cellspacing="3" cellpadding="0">
<tr>
<td width="100%"><font face="Verdana" color="white" size="4"><body vlink="white" alink="white" link="white" />
<center><a href="index.php">Home</a></center><br /></font></td>
</tr>
<tr>
<td width="100%"><font face="Verdana" color="white" size="4"><body vlink="white" alink="white" link="white" />
<center><a href="login.php">Login</a><br /></center><br /></font></td>
</tr>
<tr>
<td width="100%"><font face="Verdana" color="white" size="4"><body vlink="white" alink="white" link="white" />
<center><a href="coming.php">Forums</a><br /></center><br /></font></td>
</tr>
<tr>
<td width="100%"><font face="Verdana" color="white" size="4"><body vlink="white" alink="white" link="white" />
<center><a href="register.php">Register</a><br /></center><br /></font></td>
</tr>
</table>
</form>
<?php
}
?>
</body>
</html>

 

Thanks heaps!

Link to comment
https://forums.phpfreaks.com/topic/134963-solved-script-not-working-help/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.