/    Sign up×
Community /Pin to ProfileBookmark

Allow/ Disallow certain sites to include my file

I am using the below code to allow websites to use my content.

[code=php]<?php

$game = $_GET[‘game’];
$page = $_GET[‘page’];
$letter = $_GET[‘letter’];
$console = $_GET[‘console’];

if(!$console && !$letter && !$game && !$page) {
include(“http://www.gameslayer.co.uk/cheatserve/serve/default.php?type=content”);
} else {
include(“http://www.gameslayer.co.uk/cheatserve/serve/” . $console . $letter . $game . $page . “.php?type=content”);
}

?>[/code]

I only want to allow pre-approved sites to include my files, using the above code. As it is pre-approval i will need an allow list, and all others to be disallowed.

I’m aware i can use echo $_SERVER[‘HTTP_HOST’]; to find the domain name, which would have to be added to the first code, and possible stored as a variable and then found by the page it includes.

Is this possible?

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @danpoulton spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.15,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...