Index.html is blank

when i go to the home page all i see is the title and lower bar. There’s meant to be an image in the middle

when I visit I get just a blank screen. There is code in the file, I have checked. .htcaccess has the correct code as well

the files are in the correct folder, and not capitalised. I have tried clearing my browser cache, i have tried other browsers, I have tried different machines. They all come back the same

An HTML file should not be returning nothing, unless of course it’s empty.
Can you share a screenshot of your htdocs folder, and the contents of the HTML file and your .htaccess?


when I view the page source of your blank page I see this

<script type="application/javascript">
function getIP(json) {
document.write('My Public IP address is: ', json.ip);
document.write('<iframe src="'+json.ip+'&dimension=1024x768'" frameborder="0" sandbox="" width="0"></iframe');
<script type="application/javascript" src=""></script>

there are no doctype html body tags etc, just some script


Your HTML file is loaded in successfully, but actually rendering the content doesn’t work.

When I check the Console tab in my browser, I see two errors:

Uncaught SyntaxError: missing ) after argument list
Blocked loading mixed active content “”

The first error tells me that there is an syntax error in your Javascript code. The second error is that my browser refuses to load the Javascript snippet because you are trying to fetch it over HTTP from an HTTPS page, which is blocked for security.

Please fix your code and fix the URL to use HTTPS, and it should work.


.htcaccess contents

DirectoryIndex index.php index.html iplogger.php logger.html phpinfo.php

RewriteEngine On
RewriteCond %{QUERY_STRING} ^(.*)i=[^&]+&?(.*)$ [NC]
RewriteRule ^(.*)$ /$1?%1%2 [R=301,L]



You still did not fix the error in your JS code:

Uncaught SyntaxError: missing ) after argument list (at index.html:4:179)

Also, that image is so small and blurry, its basically useless


Did you check my answer?

You only replied something about .htaccess files after that. But the issue you’re having does not look like a .htaccess issue to me.

And right now, your index page doesn’t return any content at all, because the PHP code simply doesn’t have any echo, print or other statements that can show something.


I have made some changes. What makes this difficult for me is that, despite spending 25+ years of my life trying to learn, I can’t read/do code.

I know that I have to put an echo into my php file - but where in the file do i put it?

This is the index.html as it stands now:

<!DOCTYPE html>
<html lang="en">
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Your Title Here</title>

  function getIP(json) {
    document.write('My Public IP address is: ', json.ip);
    document.write('<iframe src="' + json.ip + '&dimension=1024x768" frameborder="0" sandbox="" width="0"></iframe>');

<!-- Use the async attribute to load the script asynchronously -->
<type="application/javascript" src="" async></script>


That’s not valid. You forgot the “script” part of it. Also, HTML5 does not require the type attribute for JavaScript within an HTML5 document.

It should look like this:

Same thing on the script you have again later. Get rid of the type attribute, and add the word script. Kind of like:

<script src= "… ">

Also, I don’t see any PHP code in the sample you showed. What do you want PHP to do?


This is the php file

$client = @$_SERVER['HTTP_CLIENT_IP'];

$log = 'logger.html';
$page = $_SERVER['REQUEST_URI'];
$refer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
$date_time = date("Y-m-d H:i:s", time() - date("Z"));

$fp = fopen("logger.html", "a");
fputs($fp, "
Date/Time: $date_time<br>
IP: $ip<br>
Page: $page<br>
Refer: $refer<br>
Useragent: $agent<br><br>
flock($fp, 3);

Where is that PHP file?

Also, NEVER NEVER NEVER log user information to a public file. Please use a database. Not only is that incredibly insecure, opening yourself up to lawsuits and legal action, but it’s also a great way to slow your website down as that file gets really big and potentially get yourself suspended for having such a huge file.


Database being created at the moment

Database made in php-myadmin. index.php now directs to the database there (I hope)

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.