尝试使用MapBox代码设置离线地图时出现以下错误:
<?php session_start(); ?> <?php include 'conexion.php'; if(isset($_POST['username'] && $_POST['password'])){ $username = $_POST['username']; $password = $_POST['password']; } $sql = "SELECT * FROM User WHERE username = '$username' OR Email ='$username'"; $result = $connection->query($sql); if ($result->num_rows > 0) { $row = $result->fetch_array(MYSQLI_ASSOC); $hash = $row['password']; if (password_verify($password,$hash)) { $_SESSION['loggedin'] = true; $_SESSION['username'] = $row['username']; $_SESSION['start'] = time(); setcookie("COOKIE_INDEFINED_SESSION",TRUE,time()+31622400); setcookie("COOKIE_DATA_INDEFINED_SESSION[username]",$username,time()+31622400); setcookie("COOKIE_DATA_INDEFINED_SESSION[password]",$password,time()+31622400); echo "Sesión abierta indefinidamente.<br/>"; $respuesta["validacion"] = "ok"; $respuesta["id"] = $row["idUser"]; $respuesta["username"] = $row["username"]; }else{ $respuesta["validacion"] = "error"; $respuesta["mensaje"] = "Contraseña incorrecta"; }mysqli_close($connection); }else{ $respuesta["validacion"] = "error"; $respuesta["mensaje"] = "Usuario incorrecto"; }mysqli_close($connection); // encoding array to json format echo json_encode($respuesta); ?>
如何解决这些问题?