php登录可以离线工作,但不能在线(raspberry pi)

时间:2019-05-10 12:39:25

标签: php

当我使用laragon来开发我的网站时,它确实可以正常登录,但是当我在网上放置服务器raspberry pi时,密码始终不正确。会是什么?

https://imgur.com/LwUuaIN

此链接中php的所有代码:

https://pastebin.com/pUQNBjpP

<?php
// Initialize the session
session_start();

// Check if the user is already logged in, if yes then redirect him to welcome page
if(isset($_SESSION["loggedin"]) && $_SESSION["loggedin"] === true){
  header("location: admin_index.php");
  exit;
}

define('DB_SERVER', 'localhost');
define('DB_USERNAME', 'xxxx');
define('DB_PASSWORD', 'xxxx');
define('DB_NAME', 'base_de_dados_museu');

/* Attempt to connect to MySQL database */
$link = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);

// Check connection
if($link === false){
    die("ERROR: Could not connect. " . mysqli_connect_error());
}

0 个答案:

没有答案