Code:
$_SERVER[HTTP_REFERER]
Don't rely on the PHP parser to convert undefined constants to strings.
Code:
echo"<meta http-equiv=\"refresh\" content=\"1;URL\" />";
Don't use <meta> refreshes when real HTTP redirection is more reliable (and must be obeyed according to the HTTP specification, unlike <meta> elements, which may be ignored). Also, don't assume XHTML. Only in a few cases is it appropriate for the webmaster to use XHTML.
would go at the top of your page, switching out the red parts for the denied domain
No, it would go inside the <head>, before any other elements (except other <meta> elements). Also, redirecting the user to the main page of the site whence they just came would cause much confusion. Instead, redirecting to a page explaining the situation and the relationship (or lack thereof) would be beneficial, from which page they could then carry on to view your site if they wished.
Code:
<?php
if(strpos($_SERVER['HTTP_REFERER'], 'URL') !== false)
die(header('Location: http://www.mysite.com/warning-this-site-is-not-affiliated-with-us.html'));
?>
That would go at the top of your page. Also note that this isn't completely reliable, since some firewalls strip Referer headers.
Bookmarks