amchacon
amchacon

Reputation: 1961

Restrict a website by IP

So, this is the thing. I have 4 groups of users (A,B,C). The thing is the next:

Ok, my first approach is create a simple index.php:

<?php
include_once '../php/.htDBconnection.php';

$group = MyDB::getGroupIp(getIp());

if($group != null)
{
        echo file_get_contents('./'.$group.'/index.html');
}
else
{
        echo "Not authorized!";
}

The problem is, shows the html but doesn't download the CSS/JS/Images content. What is the problem?

Upvotes: 1

Views: 75

Answers (1)

NiMeDia
NiMeDia

Reputation: 1004

I think you could set the base-url (http://www.hongkiat.com/blog/html-base-element/) in your subpages to ensure the sub-page uses its own asset directory.

Upvotes: 1

Related Questions