I want to match by hostname and I can’t figure out how,
example: i want to force all links to be from oi*.tinypic.com or i*.tinypic.com. However people bypass my current validation by using then adding hash at the back of the URL like .jpg#tinypic, if i use stripos() to prevent abuse on the forum.
also, how do i check it’s well formed url, of https or http? I’m using parse_url() and doing if (!$var) but it sometimes doesn’t work for some reason i don’t know
Use
parse_url()on the referer, then usestrposonly onhostpart.When
parse_url()doesn’t work, what is the result?print_ris your friend.