无论如何,我的问题是我不明白为什么会出现这个通知。是的,我知道它只是一个通知,但我希望它消失了。我已经尝试先检查会话是否已设置然后执行代码,但仍然无法正常工作。这是我的档案。
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>