Jump to content

Menu depending on login


snallemap

Recommended Posts

Alright, so meanwhile i wait for answer on the other thread i started another project, to fix the menu... but it was a bit confusing so now i ask you again!...

 

Heres my current menu.php

 

<?php
    
    include "config.php";

if (!$_SESSION["valid_user"])
        {
echo '<a href="login.php">' . 'Login <br/><br/>' . '</a>';
        }    
        
if ($_SESSION["valid_user"])
        {
echo '<a href="logout.php">' . 'Logout <br/><br/>' . '</a>';

echo '<a href="members.php">' . 'Control Panel <br/><br/>' . '</a>';
        }    


echo '<a href="memberlist.php">' . 'Members <br/><br/>' . '</a>';

echo '<a href="ranking.php">' . 'Rankings <br/><br/>' . '</a>';



?>

 

Now it works perfectly when logged in, but when you logout the session dies, leaving me with this:

 

Notice: Undefined index: valid_user in C:\wamp\www\kawaii\menu.php on line 5

Login

 

Notice: Undefined index: valid_user in C:\wamp\www\kawaii\menu.php on line 10

Members

 

Rankings

 

Now, how can i make a login that depends on if your logged in if this happens when you logout..., i hope someone can find a solution that can work out :(

Link to comment
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.