I have a simple web page with some jQuery ajax and PHP backside to easily view the error_log
quickly and erase it for debugging and development purposes.
However, I noticed in FireFox that I have a mixed-content warning. I checked on Chrome and it gave the error.
Mixed Content: The page at 'https://website/error_log.php' was loaded over HTTPS, but requested an insecure favicon 'http://website/content.php?error=404'. This request has been blocked; the content must be served over HTTPS.
This would be simpel to me as I would just have to find the Favicon and specify the correct path to it (since it's obviously not found and throwing it to the 404 page) using https. However, I do not have a favicon specified on my page at all, so why is it giving me the mixed content notice?
Error Log
<?php
if(@$_GET["unlink"]=="yes") {
if(file_exists('error_log')) {
unlink('error_log');
}
exit(0);
}
if(@$_GET["ajax"]=="yes") {
if(file_exists('error_log')) {
//$file = file_get_contents('error_log');
$fileLines = file('error_log');
// Swap the order of the array
$invertedLines = array_reverse($fileLines);
echo '<pre>';
//echo $file;
for($i=0;$i<count($invertedLines);$i++) {
echo $invertedLines[$i];
}
echo '</pre>';
}
else {
echo '<pre>';
echo '<div align="center">The error log is currently empty.</div>';
echo '</pre>';
}
exit(0);
}
?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Error Log</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>
$(document).ready(function() {
var interval;
interval = setInterval(counter, 1000);
$("#refresh").click(function(){
refreshlog();
clearInterval(interval);
$('#refresh').val("Refreshed...");
interval = setInterval(counter, 1000);
});
$("#delete").click(function(){
unlink();
});
var count = 30;
function counter() {
if(count===30) {
refreshlog();
}
count--;
//console.log(count);
$('#refresh').val('Refresh Error Log ('+count+')');
if (count === 0) {
count = 30;
}
}
function refreshlog() {
$.ajax({url: "./error_log.php?ajax=yes", success: function(result){
$("#div1").html(result);
}});
}
function unlink() {
$.ajax({url: "./error_log.php?unlink=yes", success: function(result){
refreshlog();
}});
}
});
</script>
<style>
pre
{
font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;
margin-bottom: 10px;
overflow: auto;
width: auto;
padding: 5px;
background-color: #eee;
width: 650px!ie7;
padding-bottom: 20px!ie7;
max-height: 500px;
}
</style>
</head>
<body>
<div align="center"><input type="button" id='refresh' style="border: 1px solid #050; color: #050; padding: 5px; margin: 3px; cursor: pointer;" value="Refresh Error Log"><input type="button"id='delete' style="border: 1px solid #C00; color: #c00; padding: 5px; margin: 3px; cursor: pointer;" value="Clear Error Log"></div>
<hr>
<div id='div1'></div>
<hr>
</body></html>