I am having a very strange problem. I have two php files in which I´m using html and there are in the same folder, but in one of that the favicon shows up and in the other it doesn´t. I have checked the code and the code of the two files is almost the same.
This code works:
<head>
<meta charset="utf-8">
<title>Home</title>
<link href="../css/topbar2.css" rel="stylesheet" type="text/css">
<link href="../css/home2.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.1/css/all.css">
<link rel="icon" type="image/jpg" href="../img/favicon.jpg">
</head>
In this doesn´t work:
<head>
<meta charset="utf-8">
<title>Edit Accounts</title>
<link href="../css/topbar2.css" rel="stylesheet" type="text/css">
<link href="../css/updateAccount.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.1/css/all.css">
<link rel="icon" type="image/jpg" href="../img/favicon.jpg">
</head>
EDIT: I think I know why is this happening. Before my HTML code, I have some php code, that is this:
<?php
require_once '../config.php';
require_once '../constants/sessionVariables.php';
require_once '../db/dbConnection.php';
// Se comprueba que el usuario ha iniciado sesión. Si no es así,
// se le redirige a index.php
if (!isset($_SESSION['email'])) {
header("Location: ../index.php");
exit();
}
$loginURL = $gClient->createAuthUrl();
if (isset($_POST['submit'])) {
$q = $con->real_escape_string($_POST['q']);
$f = $con->real_escape_string($_POST['f']);
$s = $_POST['submit'];
}
?>
I came to the conclusion that the error comes from the dbConnection.php file, but I don´t know why. This is the dbConenction.php code:
<?php
session_start();
$DATABASE_HOST = 'localhost';
$DATABASE_USER = 'root';
$DATABASE_PASS = '';
$DATABASE_NAME = 'configurator';
$con = mysqli_connect($DATABASE_HOST, $DATABASE_USER, $DATABASE_PASS,
$DATABASE_NAME);
if ( mysqli_connect_errno() ) {
die ('Failed to connect to MySQL: ' . mysqli_connect_error());
}
ini_set('display_errors', 1);
ini_set('log_errors', 1);
error_reporting(E_ALL);
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);