im sure i am missing something simple. but this is killing me.
i get this to work:
$url = (isset($_POST['url'])) ? $_POST['url'] : '';
$BlockedNames = array('nepwk', 'teleworm');
$BlockedDomains = array('nepwk.com', 'teleworm.com', 'yopmail.com', 'adf.ly', 'www.nepwk.com');
@list($name, $domain) = explode("http://", $url);
else if(in_array($name, $BlockedNames) || in_array($domain, $BlockedDomains)) {
$mesaj = "<div class=\"msg\"<div class=\"error\">Your URL has been blocked by our system!</div></div>";
}
now the above works if i type the whole domain for every single url i want to block
but i want to know is how would i add a catch all of sorts to the domain
so say the domain is: http://www.google.com
i want to block everything google so all of the following would be blocked as well
http://www.google.com/whatever
http://www.google.com/anything
http://www.google.com/something
i want all of those to be blocked automatically without having to add each individual one
im trying to block adf.ly links which change for each person and each url they mask and i want to take proactive measure to just block them from being added into my form instead of having them added to my database then having to go and manually delete them.
any questions or if this doesn't make sense let me know.
thanks in advance (and maybe this is bad code im a noob so go easy )