0

image Anyway, my problem is that I don't understand why this notice is showing. Yes, I'm aware that it's just a notice, but I would like it gone. I've tried checking first if the session is set then executing the code, but that still doesn't work. Here's my file.

HTML/PHP:

<?php
session_start();

if(isset($_SESSION)){
    if($_SESSION['loggedin'] == true){
        echo("Welcome, ".$_SESSION['username']. ".");

        echo("<a href='logout.php'>Logout</a>");
    }
}else{

}
?>

<!doctype html>
<html lang="en">
<head>
    <link rel="stylesheet" href="jquery-jvectormap-1.2.2.css" type="text/css" media="screen"/>
    <script src="jquery-1.11.1.js"></script>
    <script src="jquery-jvectormap-1.1.1.min.js"></script>
    <script src="jquery-jvectormap-world-mill-en.js"></script>
</head>
    <meta charset="UTF-8">
    <title>Game</title>
</head>
<body>

<?php
if(isset($_SESSION)){
    if($_SESSION['loggedin'] == true){
        include_once("connectionslol.php");

        $query = "SELECT start_finished FROM users WHERE username = '".$user."'LIMIT 1";
        $result = $mysqli->query($query) or die($mysqli->error.__LINE__);

        if($result->num_rows == 1){
            echo("<div id='world-map' style='width: 100%; height: 80%'>
        <script>
            $(function(){
                $('#world-map').vectorMap();
            });
        </script>
        </div>");
        }else{
            echo('Working lol');
        }
    }else{
        echo("You're not logged in");
    }
}
?>

</body>
</html>
racecarjonathan
  • 1,244
  • 1
  • 11
  • 22

0 Answers0