Not really a php coder so my codes are really messy

But you can secure it a little by storing your sites in an array and doing something like this:

Code: 
strpos($src, $mysites);
Which would return a boolean true or false if it has detected your designated sites or not...

But really I don't think this is secure as there are other ways to work around it. I'm still finding a better secure solution for the designated urls