Hello I have php page i need code to prevents them from working on any site out side my domain thank you
check $_SERVER["HTTP_REFERER"] if it comes from your own domain. be sure to allow both www.something.com and something.com
<?php if (!$_SERVER["HTTP_REFERER"] == 'mysite.com' || !$_SERVER["HTTP_REFERER"] == www.mysite.com) { die('Must come from this domain'); } ?> Code (markup):
If you do use $_SERVER["HTTP_REFERER"] i recommend regexing it and just compare to the domain part of the url . [edit] ps. some browsers strip the referrer so make other checks also.